Extract PDF content to Markdown using MinerU API. Supports formulas, tables, OCR. Provides both local file and online URL parsing methods.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install mineru-pdf-extractor或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install mineru-pdf-extractor⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/mineru-pdf-extractor/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: mineru-pdf-extractor description: Extract PDF content to Markdown using MinerU API. Supports formulas, tables, OCR. Provides both local file and online URL parsing methods. author: Community version: 1.0.0 homepage: https://mineru.net/ source: https://github.com/opendatalab/MinerU env: - name: MINERU_TOKEN description: "MinerU API token for authentication (primary)" required: true - name: MINERU_API_KEY description: "Alternative API token if MINERU_TOKEN is not set" required: false - name: MINERU_BASE_URL description: "API base URL (optional, defaults to https://mineru.net/api/v4)" required: false default: "https://mineru.net/api/v4" tools: required: - name: curl description: "HTTP client for API requests and file downloads" - name: unzip description: "Archive extraction tool for result ZIP files" optional: - name: jq description: "JSON processor for enhanced parsing and security (recommended)" ---
Extract PDF documents to structured Markdown using the MinerU API. Supports formula recognition, table extraction, and OCR.
> Note: This is a community skill, not an official MinerU product. You need to obtain your own API key from MinerU.
---
mineru-pdf-extractor/
├── SKILL.md # English documentation
├── SKILL_zh.md # Chinese documentation
├── docs/ # Documentation
│ ├── Local_File_Parsing_Guide.md # Local PDF parsing detailed guide (English)
│ ├── Online_URL_Parsing_Guide.md # Online PDF parsing detailed guide (English)
│ ├── MinerU_本地文档解析完整流程.md # Local parsing complete guide (Chinese)
│ └── MinerU_在线文档解析完整流程.md # Online parsing complete guide (Chinese)
└── scripts/ # Executable scripts
├── local_file_step1_apply_upload_url.sh # Local parsing Step 1
├── local_file_step2_upload_file.sh # Local parsing Step 2
├── local_file_step3_poll_result.sh # Local parsing Step 3
├── local_file_step4_download.sh # Local parsing Step 4
├── online_file_step1_submit_task.sh # Online parsing Step 1
└── online_file_step2_poll_result.sh # Online parsing Step 2
---
Scripts automatically read MinerU Token from environment variables (choose one):
# Option 1: Set MINERU_TOKEN
export MINERU_TOKEN="your_api_token_here"
# Option 2: Set MINERU_API_KEY
export MINERU_API_KEY="your_api_token_here"
curl - For HTTP requests (usually pre-installed)unzip - For extracting results (usually pre-installed)jq - For enhanced JSON parsing and security (recommended but not required) - If not installed, scripts will use fallback methods - Install: apt-get install jq (Debian/Ubuntu) or brew install jq (macOS)
# Set API base URL (default is pre-configured)
export MINERU_BASE_URL="https://mineru.net/api/v4"
> 💡 Get Token: Visit https://mineru.net/apiManage/docs to register and obtain an API Key
---
For locally stored PDF files. Requires 4 steps.
cd scripts/
# Step 1: Apply for upload URL
./local_file_step1_apply_upload_url.sh /path/to/your.pdf
# Output: BATCH_ID=xxx UPLOAD_URL=xxx
# Step 2: Upload file
./local_file_step2_upload_file.sh "$UPLOAD_URL" /path/to/your.pdf
# Step 3: Poll for results
./local_file_step3_poll_result.sh "$BATCH_ID"
# Output: FULL_ZIP_URL=xxx
# Step 4: Download results
./local_file_step4_download.sh "$FULL_ZIP_URL" result.zip extracted/
Apply for upload URL and batch_id.
Usage:
./local_file_step1_apply_upload_url.sh <pdf_file_path> [language] [layout_model]
Parameters:
language: ch (Chinese), en (English), auto (auto-detect), default chlayout_model: doclayout_yolo (fast), layoutlmv3 (accurate), default doclayout_yoloOutput:
BATCH_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
UPLOAD_URL=https://mineru.oss-cn-shanghai.aliyuncs.com/...
---
Upload PDF file to the presigned URL.
Usage:
./local_file_step2_upload_file.sh <upload_url> <pdf_file_path>
---
Poll extraction results until completion or failure.
Usage:
./local_file_step3_poll_result.sh <batch_id> [max_retries] [retry_interval_seconds]
Output:
FULL_ZIP_URL=https://cdn-mineru.openxlab.org.cn/pdf/.../xxx.zip
---
Download result ZIP and extract.
Usage:
./local_file_step4_download.sh <zip_url> [output_zip_filename] [extract_directory_name]
Output Structure:
extracted/
├── full.md # 📄 Markdown document (main result)
├── images/ # 🖼️ Extracted images
├── content_list.json # Structured content
└── layout.json # Layout analysis data
📚 Complete Guide: See docs/Local_File_Parsing_Guide.md
---
For PDF files already available online (e.g., arXiv, websites). Only 2 steps, more concise and efficient.
cd scripts/
# Step 1: Submit parsing task (provide URL directly)
./online_file_step1_submit_task.sh "https://arxiv.org/pdf/2410.17247.pdf"
# Output: TASK_ID=xxx
# Step 2: Poll results and auto-download/extract
./online_file_step2_poll_result.sh "$TASK_ID" extracted/
Submit parsing task for online PDF.
Usage:
./online_file_step1_submit_task.sh <pdf_url> [language] [layout_model]
Parameters:
pdf_url: Complete URL of the online PDF (required)language: ch (Chinese), en (English), auto (auto-detect), default chlayout_model: doclayout_yolo (fast), layoutlmv3 (accurate), default doclayout_yoloOutput:
TASK_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
---
Poll extraction results, automatically download and extract when complete.
Usage:
./online_file_step2_poll_result.sh <task_id> [output_directory] [max_retries] [retry_interval_seconds]
Output Structure:
extracted/
├── full.md # 📄 Markdown document (main result)
├── images/ # 🖼️ Extracted images
├── content_list.json # Structured content
└── layout.json # Layout analysis data
📚 Complete Guide: See docs/Online_URL_Parsing_Guide.md
---
| Feature | Local PDF Parsing | Online PDF Parsing | |---------|----------------------|------------------------| | Steps | 4 steps | 2 steps | | Upload Required | ✅ Yes | ❌ No | | Average Time | 30-60 seconds | 10-20 seconds | | Use Case | Local files | Files already online (arXiv, websites, etc.) | | File Size Limit | 200MB | Limited by source server |
---
for pdf in /path/to/pdfs/*.pdf; do
echo "Processing: $pdf"
# Step 1
result=$(./local_file_step1_apply_upload_url.sh "$pdf" 2>&1)
batch_id=$(echo "$result" | grep BATCH_ID | cut -d= -f2)
upload_url=$(echo "$result" | grep UPLOAD_URL | cut -d= -f2)
# Step 2
./local_file_step2_upload_file.sh "$upload_url" "$pdf"
# Step 3
zip_url=$(./local_file_step3_poll_result.sh "$batch_id" | grep FULL_ZIP_URL | cut -d= -f2)
# Step 4
filename=$(basename "$pdf" .pdf)
./local_file_step4_download.sh "$zip_url" "${filename}.zip" "${filename}_extracted"
done
...
安装 MinerU PDF Extractor 后,可以对 AI 说这些话来触发它
Help me get started with MinerU PDF Extractor
Explains what MinerU PDF Extractor does, walks through the setup, and runs a quick demo based on your current project
Use MinerU PDF Extractor to extract PDF content to Markdown using MinerU API
Invokes MinerU PDF Extractor with the right parameters and returns the result directly in the conversation
What can I do with MinerU PDF Extractor in my documents & notes workflow?
Lists the top use cases for MinerU PDF Extractor, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/mineru-pdf-extractor/ 目录(个人级,所有项目可用),或 .claude/skills/mineru-pdf-extractor/(项目级)。重启 AI 客户端后,用 /mineru-pdf-extractor 主动调用,或让 AI 根据上下文自动发现并使用。
MinerU PDF Extractor 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
MinerU PDF Extractor 可免费安装使用。请查阅仓库了解许可证信息。
Extract PDF content to Markdown using MinerU API. Supports formulas, tables, OCR. Provides both local file and online URL parsing methods.
MinerU PDF Extractor 属于「Documents & Notes」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my documents & notes tasks using MinerU PDF Extractor
Identifies repetitive steps in your workflow and sets up MinerU PDF Extractor to handle them automatically