WenjieLi

Mineru Pdf

办公效率v1.0.0
作者:WenjieLi更新于 2026-05-17mineru-pdf@clawhub_etoile04/mineru-pdf
PDF 处理#PDF

据 AlphaMoat 统计,截至 2026-09,Mineru Pdf 累计下载 2,097 次、获 0 个星标,在全部 5,078 个 AI 技能中排名第 4,363 位,在「办公效率」分类(435 个)中排名第 334 位。

累计安装
102
累计下载
2,097
星标
-
全站排名
#4,363
全站前 86% · 「办公效率」前 77%
平台累计安装累计下载星标评论
ClawHub ↗521,781--
SkillHub ↗1022,097-—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

它可提取结构化文本、表格和公式,支持扫描件 OCR、选择处理页范围及切换解析后端。MCP 方式的临时文件会在任务结束时清理;直接工具会将结果保存到用户指定目录。首次运行可能下载模型。处理敏感文档前应确认运行环境、模型来源及输出位置的隐私与保留方式。

资料发布于 2026-10-29

可以用来做什么

  • 从 PDF 或支持的图像中提取文本、表格和公式。
  • 指定页范围、识别表格或公式,并选择适合环境的后端。
  • 将解析结果整理成 Markdown 供后续检查。

什么时候用

  • 需要从 PDF 或扫描件中提取结构化内容时。
  • 需要处理表格、数学公式或限定文档页范围时。
  • 处理敏感文件、下载模型或选择持久化输出目录前,需要确认数据处理和文件保留方式时。

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

解析这份我有权处理的 PDF 并提取文本、表格和公式;将输出保存到我指定的目录。
对扫描页进行 OCR 前,列出会读取的文件、使用的后端和结果保存位置。

月度数据趋势

累计下载2,097
7281,4632,1982026-03 · 累计下载 8292026-05 · 累计下载 1,2642026-07 · 累计下载 1,6072026-08 · 累计下载 1,7842026-09 · 累计下载 2,09726-0326-09
星标-
0112026-03 · 星标 -2026-05 · 星标 -2026-07 · 星标 -2026-08 · 星标 -2026-09 · 星标 -26-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-092,097—-
2026-081,784+11.0%-
2026-071,607—-
2026-051,264—-
2026-03829—-

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

8.9 KB · ClawHub v1.0.0
---
name: mineru-pdf
description: Parse PDF documents with MinerU MCP to extract text, tables, and formulas. Supports multiple backends including MLX-accelerated inference on Apple Silicon.
homepage: https://github.com/TINKPA/mcp-mineru
metadata:
  {
    "openclaw":
      {
        "emoji": "📄",
        "requires": { "bins": ["uvx"] },
展开全部(共 353 行)
        "install":
          [
            {
              "id": "uvx",
              "kind": "uvx",
              "package": "mcp-mineru",
              "label": "Install mcp-mineru via uvx (auto-managed)",
            },
          ],
      },
  }
---

# MinerU PDF Parser

Parse PDF documents using MinerU MCP to extract structured content including text, tables, and formulas with MLX acceleration on Apple Silicon.

## Installation

### Option 1: Install MinerU MCP (for Claude Code)

```bash
claude mcp add --transport stdio --scope user mineru -- \
  uvx --from mcp-mineru python -m mcp_mineru.server
```

This installs and configures MinerU for all Claude projects. Models are downloaded on first use.

### Option 2: Use Direct Tool (preserves files)

The skill includes a direct parsing tool that saves output to a persistent directory:

```bash
python /Users/lwj04/clawd/skills/mineru-pdf/parse.py <pdf_path> <output_dir> [options]
```

**Advantages:**
- ✅ Files are saved permanently (not auto-deleted)
- ✅ Full control over output location
- ✅ No MCP overhead
- ✅ Works with any Python environment that has MinerU

## Quick Start

### Method 1: Using the Direct Tool (Recommended)

```bash
# Parse entire PDF
python /Users/lwj04/clawd/skills/mineru-pdf/parse.py \
  "/path/to/document.pdf" \
  "/path/to/output"

# Parse specific pages
python /Users/lwj04/clawd/skills/mineru-pdf/parse.py \
  "/path/to/document.pdf" \
  "/path/to/output" \
  --start-page 0 --end-page 2

# Use Apple Silicon optimization
python /Users/lwj04/clawd/skills/mineru-pdf/parse.py \
  "/path/to/document.pdf" \
  "/path/to/output" \
  --backend vlm-mlx-engine

# Text only (faster)
python /Users/lwj04/clawd/skills/mineru-pdf/parse.py \
  "/path/to/document.pdf" \
  "/path/to/output" \
  --no-table --no-formula
```

### Method 2: Using MinerU MCP (Temporary Files)

### Parse a PDF document

```bash
uvx --from mcp-mineru python -c "
import asyncio
from mcp_mineru.server import call_tool

async def parse_pdf():
    result = await call_tool(
        name='parse_pdf',
        arguments={
            'file_path': '/path/to/document.pdf',
            'backend': 'pipeline',
            'formula_enable': True,
            'table_enable': True,
            'start_page': 0,
            'end_page': -1  # -1 for all pages
        }
    )
    if hasattr(result, 'content'):
        for item in result.content:
            if hasattr(item, 'text'):
                print(item.text)
                break

asyncio.run(parse_pdf())
"
```

### Check system capabilities

```bash
uvx --from mcp-mineru python -c "
import asyncio
from mcp_mineru.server import call_tool

async def list_backends():
    result = await call_tool(
        name='list_backends',
        arguments={}
    )
    if hasattr(result, 'content'):
        for item in result.content:
            if hasattr(item, 'text'):
                print(item.text)
                break

asyncio.run(list_backends())
"
```

## Parameters

### parse_pdf

**Required:**
- `file_path` - Absolute path to the PDF file

**Optional:**
- `backend` - Processing backend (default: `pipeline`)
  - `pipeline` - Fast, general-purpose (recommended)
  - `vlm-mlx-engine` - Fastest on Apple Silicon (M1/M2/M3/M4)
  - `vlm-transformers` - Slowest but most accurate
- `formula_enable` - Enable formula recognition (default: `true`)
- `table_enable` - Enable table recognition (default: `true`)
- `start_page` - Starting page (0-indexed, default: `0`)
- `end_page` - Ending page (default: `-1` for all pages)

### list_backends

No parameters required. Returns system information and backend recommendations.

## Usage Examples

### Extract tables from a specific page range

```bash
uvx --from mcp-mineru python -c "
import asyncio
from mcp_mineru.server import call_tool

async def parse_pdf():
    result = await call_tool(
        name='parse_pdf',
        arguments={
            'file_path': '/path/to/document.pdf',
            'backend': 'pipeline',
            'table_enable': True,
            'start_page': 5,
            'end_page': 10
        }
    )
    if hasattr(result, 'content'):
        for item in result.content:
            if hasattr(item, 'text'):
                print(item.text)
                break

asyncio.run(parse_pdf())
"
```

### Parse with formula recognition only (faster)

```bash
uvx --from mcp-mineru python -c "
import asyncio
from mcp_mineru.server import call_tool

async def parse_pdf():
    result = await call_tool(
        name='parse_pdf',
        arguments={
            'file_path': '/path/to/document.pdf',
            'backend': 'vlm-mlx-engine',
            'formula_enable': True,
            'table_enable': False  # Disable for speed
        }
    )
    if hasattr(result, 'content'):
        for item in result.content:
            if hasattr(item, 'text'):
                print(item.text)
                break

asyncio.run(parse_pdf())
"
```

### Parse single page (fastest for testing)

```bash
uvx --from mcp-mineru python -c "
import asyncio
from mcp_mineru.server import call_tool

async def parse_pdf():
    result = await call_tool(
        name='parse_pdf',
        arguments={
            'file_path': '/path/to/document.pdf',
            'backend': 'pipeline',
            'formula_enable': False,
            'table_enable': False,
            'start_page': 0,
            'end_page': 0
        }
    )
    if hasattr(result, 'content'):
        for item in result.content:
            if hasattr(item, 'text'):
                print(item.text)
                break

asyncio.run(parse_pdf())
"
```

## Performance

On Apple Silicon M4 (16GB RAM):
- `pipeline`: ~32s/page, CPU-only, good quality
- `vlm-mlx-engine`: ~38s/page, Apple Silicon optimized, excellent quality
- `vlm-transformers`: ~148s/page, highest quality, slowest

**Note:** First run downloads models (can take 5-10 minutes). Models are cached in `~/.cache/uv/` for faster subsequent runs.

## Output Format

Returns structured Markdown with:
- Document metadata (file, backend, pages, settings)
- Extracted text with preserved structure
- Tables formatted as Markdown tables
- Formulas converted to LaTeX

## Supported Formats

- PDF documents (`.pdf`)
- JPEG images (`.jpg`, `.jpeg`)
- PNG images (`.png`)
- Other image formats (WebP, GIF, etc.)

## Troubleshooting

### Module not found error

If you get "No module named 'mcp_mineru'", make sure you installed it:

```bash
claude mcp add --transport stdio --scope user mineru -- \
  uvx --from mcp-mineru python -m mcp_mineru.server
```

### Slow processing on first run

This is normal. MinerU downloads ML models on first use. Subsequent runs will be much faster.

### Timeout errors

Increase timeout for large documents or use smaller page ranges for testing.

## Notes

- Output is returned as Markdown text
- Tables are preserved in Markdown format
- Mathematical formulas are converted to LaTeX
- Works with scanned documents (OCR built-in)
- Optimized for Apple Silicon (M1/M2/M3/M4) with MLX backend

## File Persistence

### Why Files Get Deleted (MCP Method)

The MinerU MCP server uses Python's `tempfile.TemporaryDirectory()`, which automatically deletes files when the context exits. This is by design to prevent temporary files from accumulating.

### How to Preserve Files

**Method A: Use the Direct Tool (Recommended)**

The skill provides `parse.py` which saves files to a persistent directory:

```bash
python /Users/lwj04/clawd/skills/mineru-pdf/parse.py \
  /path/to/input.pdf \
  /path/to/output_dir
```

**Advantages:**
- ✅ Files are never auto-deleted
- ✅ Full control over output location
- ✅ Can be used in batch processing
- ✅ No MCP connection needed

**Generated Structure:**
```
/path/to/output_dir/
├── input.pdf_name/
│   └── auto/          # or vlm/ depending on backend
│       ├── input.pdf_name.md
│       └── images/
│           └── *.jpg
└── input.pdf_name_parsed.md  # Copy at root for easy access
```

**Method B: Redirect MCP Output**

If using the MCP method, capture the output and save it:

```bash
# Capture to file
claude -p "Parse this PDF: /path/to/file.pdf" > /tmp/output.md

# Or use within a script that saves the result
```

### Comparison

| Feature | Direct Tool | MCP Method |
|----------|-------------|-------------|
| Files persisted | ✅ Yes | ❌ No (auto-deleted) |
| Custom output dir | ✅ Yes | ❌ No (temp only) |
| Claude Code integration | ⚠️ Manual | ✅ Native |
| Speed | ✅ Fast | ⚠️ MCP overhead |
| Offline use | ✅ Yes | ⚠️ Needs Claude Code |

### Recommendation

- **Use Direct Tool** when you need to keep the files for later use
- **Use MCP Method** when working within Claude Code and only need the text content

「办公效率」分类下的热门技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。