mang30/myskills/pdf-to-md-mineru

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Convert PDF papers to Markdown using MinerU's cloud API for high-quality document parsing with formula, table, and layout recognition. Use this skill whenever the user wants to convert a PDF paper/document to Markdown (.md) format, or mentions "MinerU", "论文转 markdown", "PDF 转 md", "paper to markdown", "extract paper content", or wants structured text extraction from academic PDFs. Also trigger when the user uploads a PDF and asks to "parse it", "extract content", "转成文本", or wants readable markdown output from a research paper. This skill supports both the Precise API (Token required, up to 200MB/600 pages, vlm/pipeline models) and the Agent Lightweight API (no token, up to 10MB/20 pages).

Install

npx vskill@latest install mang30/myskills/pdf-to-md-mineru

SKILL.md

PDF to Markdown via MinerU API

Convert PDF documents (especially academic papers) to high-quality Markdown using MinerU's cloud parsing API. MinerU excels at recognizing complex layouts, mathematical formulas, tables, and figures commonly found in research papers.

Prerequisites

  • Python 3 with requests and zipfile available
  • Network access to https://mineru.net (the MinerU API endpoint)
  • For the Precise API: a MinerU API Token (apply at https://mineru.net/apiManage)
  • For the Agent Lightweight API: no token needed (IP rate-limited)

Quick Decision: Which API to Use

ConditionUse
File ≤ 10MB and ≤ 20 pages, quick extraction neededAgent Lightweight API
File > 10MB or > 20 pagesPrecise API (Token required)
Need vlm model or extra formats (docx/html/latex)Precise API (Token required)
User explicitly mentions token or precise/vlmPrecise API
No token available, small fileAgent Lightweight API

If the user has not specified a preference and the file is small, default to the Agent Lightweight API for zero-friction usage. Ask the user if they have a MinerU token only when the file exceeds lightweight limits.

Workflow

Step 1: Determine the input source

The PDF can come from:

  1. A URL — the user provides a direct link to the PDF
  2. A local file — the user uploads a PDF to /mnt/user-data/uploads/

If the PDF is a local file, you need to upload it to get it parsed. The approach differs by API:

  • Precise API: Use the batch file upload endpoint to get a presigned URL, then PUT the file
  • Agent Lightweight API: Use the /api/v1/agent/parse/file endpoint to get a signed upload URL, then PUT the file

If the PDF is a URL, you can submit it directly.

Step 2: Check for token

Look for a MinerU token. The user may provide it directly, or it may be stored in an environment variable. Common locations:

  • Environment variable: MINERU_API_TOKEN
  • The user states it in conversation

If no token is found and the file fits within lightweight limits (≤ 10MB, ≤ 20 pages), use the Agent Lightweight API without asking. If the file exceeds limits, ask the user to provide a token.

Step 3: Run the conversion script

Execute the conversion using the bundled script:

bash
python /path/to/skill/scripts/mineru_pdf_to_md.py \
--input <pdf_path_or_url> \
--output <output_dir> \
[--token <token>] \
[--model vlm|pipeline] \
[--language ch] \
[--enable-ocr] \
[--timeout 600] \
[--api precise|agent]

Key arguments:

  • --input: PDF file path or URL
  • --output: Directory to save the resulting .md file (defaults to current directory)
  • --token: MinerU API token (required for Precise API, omit for Agent API)
  • --model: vlm (recommended, better accuracy) or pipeline (faster). Default: vlm. Only for Precise API
  • --language: Document language, default ch (Chinese+English). Use en for English-only papers
  • --enable-ocr: Enable OCR for scanned PDFs
  • --api: Force precise or agent API. Auto-detected if omitted
  • --timeout: Max seconds to wait for parsing, default 600
Step 4: Deliver the output

After the script completes:

  1. The .md file will be in the output directory
  2. Copy it to /mnt/user-data/outputs/ for the user to download
  3. Optionally show a preview of the first ~50 lines

If the Precise API was used, the script also downloads and extracts the full zip (containing images, JSON, etc.) into a subfolder. The main markdown file is full.md inside the zip.

Error Handling

SymptomLikely causeFix
Token error (A0202/A0211)Invalid or expired tokenAsk user to refresh token at mineru.net
File too large (-60005 / -30001)Exceeds size limitSwitch API or compress PDF
Too many pages (-60006 / -30003)Page limit exceededUse --page-range to select pages, or use Precise API
Network timeout (-60008)URL unreachable from ChinaAsk user to provide an accessible URL or upload locally
Rate limit (HTTP 429)Agent API IP limitWait and retry, or switch to Precise API with token

Tips for Academic Papers

  • Use --model vlm for papers with complex layouts, multi-column text, or heavy math — vlm model gives significantly better results on academic content
  • For papers in English only, set --language en for slightly better OCR accuracy
  • If the paper has scanned pages or image-based text, add --enable-ocr
  • The resulting markdown preserves LaTeX math notation (inline $...$ and display $$...$$), which is ideal for further processing or reading in markdown renderers that support math

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/mang30/myskills/pdf-to-md-mineru/badge)](https://verified-skill.com/skills/mang30/myskills/pdf-to-md-mineru)

Something wrong with this skill or its page? Tell us.