mineru-pdf-converter

mineru-pdf-converter is a skill for Claude Code, Codex from InternScience/ChemClaw. It costs 152 tokens per session (1,490 once invoked), scanned A, original, MIT.

A PDF-to-Markdown converter that uses the MinerU service to extract text, images, tables, formulas, and document structure. Markdown is plain text with simple formatting that is easy to edit and process in code.

In plain words
What is it for?
Use it to convert individual PDFs or folders of PDFs, process documents longer than 600 pages in parts, and produce Markdown, images, layout metadata, and a copy of the original PDF.
Why use it?
It turns difficult-to-search PDF layouts into organized files while keeping extracted images and other document elements available separately.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python scripts/pdf_to_markdown.py ./pdfs/ -t $MINERU_API_TOKEN -o ./output/.

Good fit Use it to convert individual PDFs or folders of PDFs, process documents longer than 600 pages in parts, and produce Markdown, images, layout metadata, and a copy of the original PDF.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/InternScience/ChemClaw
agentmods
npx agentmods add skills/internscience/chemclaw/mineru-pdf-converter

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mineru-pdf-converter

README.md
[![agentmods](https://agentmods.dev/badge/skills/internscience/chemclaw/mineru-pdf-converter/github.svg)](https://agentmods.dev/skills/internscience/chemclaw/mineru-pdf-converter)
Your own site
<a href="https://agentmods.dev/skills/internscience/chemclaw/mineru-pdf-converter"><img src="https://agentmods.dev/badge/skills/internscience/chemclaw/mineru-pdf-converter/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mineru-pdf-converter

Your own site · 80×15
<a href="https://agentmods.dev/skills/internscience/chemclaw/mineru-pdf-converter"><img src="https://agentmods.dev/badge/skills/internscience/chemclaw/mineru-pdf-converter.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 152 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,490 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00152 $0.01490
Opus 5 $0.00076 $0.00745
Sonnet 5 $0.00030 $0.00298
Haiku 4.5 $0.00015 $0.00149

Measured 11d ago against content hash c4f9cd4739d5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

mineru-pdf-converter scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/pdf_to_markdown.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/mineru-pdf-converter/SKILL.md · 169 lines

How it starts

The opening of the file, as written. The whole thing — 169 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MinerU PDF Converter | PDF转Markdown工具

将 PDF 文件转换为 Markdown 格式,完整保留图片、表格、公式和文档结构。支持超过 600 页的大文件自动分批处理。

功能特性

  • 提取文本、图片、表格、公式
  • 保留文档原始布局和格式
  • 自动处理超过 600 页的大文件(智能拆分、分批转换、自动合并)
  • 输出包含:
    • full.md - 主 Markdown 文件
    • images/ - 提取的图片目录
    • *.json - 布局分析和内容元数据
    • *_origin.pdf - 原始 PDF 副本

快速开始

环境准备

需要 Python 3.8+ 和依赖包:

pip install requests urllib3 pymupdf

API Token 配置

Skill 已内置 API Key,无需额外配置即可使用

如需使用自己的 Token,可通过以下方式(优先级从高到低):

# 方式1: 命令行参数(最高优先级)
python scripts/pdf_to_markdown.py paper.pdf -t YOUR_TOKEN

# 方式2: 环境变量
export MINERU_API_TOKEN="your-api-token"

# 方式3: 修改 Skill 内置 Key
# 编辑 API_KEY 文件 (位于 skill 目录下)

使用方法

命令行
# 单个文件(自动处理大文件)
python scripts/pdf_to_markdown.py paper.pdf -t $MINERU_API_TOKEN

# 批量转换整个目录
python scripts/pdf_to_markdown.py ./pdfs/ -t $MINERU_API_TOKEN -o ./output/

# 指定模型版本
python scripts/pdf_to_markdown.py paper.pdf -t $MINERU_API_TOKEN -m vlm
Python API
from scripts.pdf_to_markdown import convert_pdf, convert_large_pdf, batch_convert, get_api_token

# 获取 Token(自动从环境变量或 Skill 内置获取)
token = get_api_token()

# 单个文件转换(自动检测文件大小,大文件自动分批处理)
result = convert_large_pdf(
    token=token,
    pdf_path="large_paper.pdf",  # 支持任意页数
    output_dir="output/paper",
    model_version="vlm"
)
print(result["files"])  # 查看提取的所有文件
print(result.get("batches"))  # 如果分批处理,显示批次数量

# 批量转换
results = batch_convert(
    token=token,
    pdf_paths=["a.pdf", "b.pdf"],
    output_base_dir="output"
)

大文件处理说明

MinerU API 单文件限制 600 页。本 Skill 已内置智能处理:

  1. 自动检测:检测 PDF 页数是否超过 600 页
  2. 智能拆分:按 600 页为一批次拆分 PDF(使用 PyMuPDF)
  3. 分批转换:依次转换每个批次
  4. 自动合并:将各批次的 Markdown 和图片合并为完整文件
  5. 清理临时文件:处理完成后自动清理拆分产生的临时文件

示例输出(1655 页 PDF):

[LargePDF] 总页数: 1655
[LargePDF] 文件超过 600 页,需要分批处理
[Split] PDF 共 1655 页,将拆分为 3 个批次(每批最多 600 页)
[Split] 批次 1/3: 第 1-600 页 -> orca_part001.pdf
[Split] 批次 2/3: 第 601-1200 页 -> orca_part002.pdf
[Split] 批次 3/3: 第 1201-1655 页 -> orca_part003.pdf

# 各批次依次转换...

[Merge] 合并 3 个 Markdown 文件...
[LargePDF] 大文件处理完成!

Read the full file on GitHub · 169 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 169 lines · 152 tokens per session scan A c4f9cd4739d5

Subscribe to this mod's changes

mineru-pdf-converter is a skill published in the GitHub repository InternScience/ChemClaw (52 stars, last pushed 5mo ago), licensed MIT. It adds 152 tokens to every session and 1,490 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories