米奈鲁mcp
MCP服务器 矿工 文档解析API-从PDF、DOC和图像中提取文本、表格和公式。
特性
- VLM模型 --复杂文档的准确率超过90%
- 流水线模型 --快速处理简单文档
- 本地文件上传 --从磁盘上传文件进行批解析
- 批处理 --一次最多解析200个文档
- 下载并重命名 --使用原始文件名提取markdown
- 页面范围 --仅提取特定页面
- 109种语言OCR 支持
- 针对Claude代码进行了优化 --与替代方案相比,代币减少73%
工具
| 工具 | 说明 |
|---|---|
mineru_parse | 解析文档URL |
mineru_status | 检查任务进度,获取下载URL |
mineru_batch | 解析多个URL(最多200个) |
mineru_batch_status | 使用分页获取批处理结果 |
mineru_upload_batch | 上传本地文件进行批量解析 |
mineru_download_results | 将结果下载为命名的markdown文件 |
安装
需要 18+和a MinerU API密钥.
CLI安装(单行)
# Claude Code
claude mcp add mineru-mcp -e MINERU_API_KEY=your-api-key -- npx -y mineru-mcp
# Codex CLI (OpenAI)
codex mcp add mineru --env MINERU_API_KEY=your-api-key -- npx -y mineru-mcp
# Gemini CLI (Google)
gemini mcp add -e MINERU_API_KEY=your-api-key mineru npx -y mineru-mcp克劳德桌面
添加到您的 claude_desktop_config.json:
| 操作系统 | 配置路径 |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| 窗户 | %APPDATA%\Claude\claude_desktop_config.json |
| Linux | ~/.config/Claude/claude_desktop_config.json |
{
"mcpServers": {
"mineru": {
"command": "npx",
"args": ["-y", "mineru-mcp"],
"env": {
"MINERU_API_KEY": "your-api-key"
}
}
}
}VS Code
增添 .vscode/mcp.json (工作区)或打开命令面板> MCP: Open User Configuration (全球):
{
"servers": {
"mineru": {
"command": "npx",
"args": ["-y", "mineru-mcp"],
"env": {
"MINERU_API_KEY": "your-api-key"
}
}
}
}备注:VS代码使用"servers"作为顶级密钥,不是"mcpServers"其他VS代码分支(Trae、Void、PearAI等)通常使用相同的格式。
光标
增添 ~/.cursor/mcp.json (全球)或 .cursor/mcp.json (项目):
{
"mcpServers": {
"mineru": {
"command": "npx",
"args": ["-y", "mineru-mcp"],
"env": {
"MINERU_API_KEY": "your-api-key"
}
}
}
}帆板运动
增添 ~/.codeium/windsurf/mcp_config.json (Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json):
{
"mcpServers": {
"mineru": {
"command": "npx",
"args": ["-y", "mineru-mcp"],
"env": {
"MINERU_API_KEY": "your-api-key"
}
}
}
}克莱恩
在临床面板>配置>高级MCP设置中打开MCP服务器图标,然后添加:
{
"mcpServers": {
"mineru": {
"command": "npx",
"args": ["-y", "mineru-mcp"],
"env": {
"MINERU_API_KEY": "your-api-key"
}
}
}
}樱桃工作室
在“设置”>“MCP服务器”>“添加服务器”中,将“类型”设置为 STDIO,命令 npx,Args to -y mineru-mcp,并添加环境变量 MINERU_API_KEY。或者以JSON/Code模式粘贴:
{
"mineru": {
"name": "MinerU",
"command": "npx",
"args": ["-y", "mineru-mcp"],
"env": {
"MINERU_API_KEY": "your-api-key"
},
"isActive": true
}
}机智
在“设置”>“MCP服务器”中,添加一个类型为的新服务器: stdio,命令: npx,Args: -y mineru-mcp,并设置环境变量 MINERU_API_KEY 到您的API密钥。
Codex命令行界面(TOML配置)
或者,编辑 ~/.codex/config.toml 直接:
[mcp_servers.mineru]
command = "npx"
args = ["-y", "mineru-mcp"]
[mcp_servers.mineru.env]
MINERU_API_KEY = "your-api-key"Gemini CLI(JSON配置)
或者,编辑 ~/.gemini/settings.json 直接:
{
"mcpServers": {
"mineru": {
"command": "npx",
"args": ["-y", "mineru-mcp"],
"env": {
"MINERU_API_KEY": "your-api-key"
}
}
}
}视窗
在Windows上, npx 需要一个shell包装器。替换 "command": "npx" 与:
{
"command": "cmd",
"args": ["/c", "npx", "-y", "mineru-mcp"],
"env": {
"MINERU_API_KEY": "your-api-key"
}
}对于Windows上的CLI工具:
claude mcp add mineru-mcp -e MINERU_API_KEY=your-api-key -- cmd /c npx -y mineru-mcp
codex mcp add mineru --env MINERU_API_KEY=your-api-key -- cmd /c npx -y mineru-mcpChatGPT
ChatGPT仅支持通过HTTPS的远程MCP服务器,不直接支持像这样的本地stdio服务器。您需要部署在具有HTTP传输的公共URL后面。
配置
| 环境变量 | 默认值 | 描述 |
|---|---|---|
MINERU_API_KEY | (必需) | 您的MinerU API Bearer代币 |
MINERU_BASE_URL | https://mineru.net/api/v4 | API基本URL |
MINERU_DEFAULT_MODEL | pipeline | 默认型号: pipeline 或 vlm |
获取API密钥: mineru.net
用法
解析单个URL
mineru_parse({
url: "https://example.com/document.pdf",
model: "vlm", // optional: "pipeline" (default) or "vlm" (90% accuracy)
pages: "1-10,15", // optional: page ranges
ocr: true, // optional: enable OCR (pipeline only)
formula: true, // optional: formula recognition
table: true, // optional: table recognition
language: "en", // optional: language code
formats: ["html"] // optional: extra export formats
})检查任务进度
mineru_status({
task_id: "abc-123",
format: "concise" // optional: "concise" (default) or "detailed"
})简洁的输出: done | abc-123 | https://cdn-mineru.../result.zip
批量解析URL
mineru_batch({
urls: ["https://example.com/doc1.pdf", "https://example.com/doc2.pdf"],
model: "vlm"
})检查批处理进度
mineru_batch_status({
batch_id: "batch-123",
limit: 10, // optional: max results (default: 10)
offset: 0, // optional: skip first N results
format: "concise" // optional: "concise" or "detailed"
})上传本地文件
mineru_upload_batch({
directory: "/path/to/pdfs", // scan directory for supported files
// OR
files: ["/path/to/doc1.pdf", "/path/to/doc2.pdf"], // explicit file list
model: "vlm", // optional
formula: true, // optional
table: true, // optional
language: "en", // optional
formats: ["html"] // optional
})退货 batch_id 用于跟踪。每个文件的原始名称通过以下方式保留 data_id (空格变成下划线)。
以降价形式下载结果
mineru_download_results({
batch_id: "batch-123", // from mineru_upload_batch or mineru_batch
output_dir: "/path/to/output",
overwrite: false // optional: overwrite existing files
})输出文件名来源于 data_id (例如。, my_paper_title.md).原始文件名中的空格变为下划线。
典型的本地文件工作流程
mineru_upload_batch → mineru_batch_status (poll) → mineru_download_results支持格式
- PDF、DOC、DOCX、PPT、PPTX
- PNG、JPG、JPEG
限制
- 单个文件:最大200MB,最大600页
- 每日配额:高优先级2000页
- 批处理:每个请求最多200个文件
许可证
麻省理工学院

