MCP Server for MinerU DocParse API — 将 Word/PDF/PPT/Excel 转为 Markdown
Project description
mineru-docparse-mcp
MCP Server that converts Word / PDF / PPT / Excel to Markdown, powered by the MinerU DocParse API.
This project is a protocol wrapper — it does not parse documents itself. You need a running MinerU DocParse service, defaulting to
http://localhost:8000. See the MinerU repository for deployment instructions.
Installation
pip install mineru-docparse-mcp
Setup with Claude Code
The output directory is a server-side setting (not a per-request parameter), so MINERU_OUTPUT_DIR must be configured in advance:
{
"mcpServers": {
"mineru": {
"command": "uvx",
"args": ["mineru-docparse-mcp"],
"env": {
"MINERU_API_URL": "http://localhost:8000",
"MINERU_OUTPUT_DIR": "/Users/yourname/Documents/mineru-output"
}
}
}
}
Once configured, Claude will automatically invoke the tools below. All parsed results are saved to MINERU_OUTPUT_DIR.
Tools
| Tool | Description |
|---|---|
mineru_parse_document |
Convert PDF/Word/PPT/Excel to Markdown, saved to disk |
mineru_health_check |
Check MinerU service health |
Output format: Results are saved exactly as returned by MinerU. When response_format_zip=true (the default) output is saved as .zip; when false as .json. File name matches the source file — if a file with the same name already exists, a timestamp is appended to avoid overwriting.
API Parameters
mineru_parse_document mirrors the MinerU /file_parse endpoint:
| Parameter | Type | Default | Description |
|---|---|---|---|
file_path |
string | required | Local document path (absolute or relative) |
backend |
enum | hybrid-engine |
Parsing backend, see "backend options" below |
lang_list |
string[] | ["ch"] |
OCR language list, only for pipeline backend |
effort |
medium | high |
medium |
hybrid backends only. medium: faster, no chart analysis; high: higher accuracy with chart analysis, slower |
parse_method |
auto | txt | ocr |
auto |
PDF parsing method for pipeline/hybrid: auto-detect / text extraction / OCR |
formula_enable |
bool | true |
Enable formula parsing (LaTeX) |
table_enable |
bool | true |
Enable table parsing |
image_analysis |
bool | true |
Enable image/chart analysis (VLM/hybrid backends only) |
server_url |
string | null | null |
OpenAI-compatible server URL, required for *-http-client backends |
return_md |
bool | true |
Include Markdown content in response |
return_middle_json |
bool | false |
Include intermediate JSON in response |
return_model_output |
bool | false |
Include raw model output JSON in response |
return_content_list |
bool | false |
Include content list JSON in response |
return_images |
bool | false |
Include extracted images in response |
response_format_zip |
bool | true (this project's default; API default is false) |
Return results as ZIP (false returns JSON) |
return_original_file |
bool | false |
Include processed original file in ZIP (response_format_zip=true only) |
client_side_output_generation |
bool | false |
Defer final Markdown/content-list generation to the client |
start_page_id |
int | 0 |
Starting page (0-indexed) |
end_page_id |
int | 99999 |
Ending page (0-indexed) |
Backend Options
| Value | Description |
|---|---|
pipeline |
General-purpose, multilingual, no hallucination |
vlm-engine |
Local compute, high accuracy, Chinese/English only |
vlm-http-client |
Remote compute (OpenAI-compatible), high accuracy, Chinese/English only |
hybrid-engine (default) |
Local compute, hybrid parsing, multilingual, tune with effort |
hybrid-http-client |
Primarily remote compute + light local, hybrid parsing, multilingual |
Language Options (lang_list)
ch (Chinese/English/Japanese/Traditional/Latin), ch_server, korean, ta (Tamil), te (Telugu), ka (Kannada), th (Thai), el (Greek), arabic, east_slavic, cyrillic, devanagari. Only applies to the pipeline backend; ignored by others.
Server Configuration (Environment Variables)
These are server startup settings — configure them in the env field of your MCP config, not as per-request parameters.
| Variable | Default | Description |
|---|---|---|
MINERU_API_URL |
http://localhost:8000 |
MinerU service URL |
MINERU_OUTPUT_DIR |
none (required) | Directory for parsed results (absolute or relative paths) |
MINERU_API_TIMEOUT |
600 |
Request timeout in seconds — increase for large files |
MCP_TRANSPORT |
stdio |
Transport mode: stdio (local subprocess) or streamable-http (remote) |
MCP_HOST |
127.0.0.1 |
Listen address (HTTP mode only); set to 0.0.0.0 to expose externally |
MCP_PORT |
8001 |
Listen port (HTTP mode only) |
Remote Deployment (Optional)
To run the MCP server on a dedicated machine accessible by multiple clients, use HTTP mode:
MCP_TRANSPORT=streamable-http MCP_PORT=8001 MINERU_OUTPUT_DIR=/data/mineru-output uvx mineru-docparse-mcp
Clients connect via URL:
{
"mcpServers": {
"mineru": {
"type": "streamableHttp",
"url": "http://<server-address>:8001/mcp"
}
}
}
Omitting MCP_TRANSPORT defaults to local stdio mode (the "Setup with Claude Code" flow above), which is sufficient for personal use.
FAQ
"MINERU_OUTPUT_DIR environment variable not configured" — This is a required server setting, not an API parameter. Set it in the env field of your MCP config and restart the MCP connection.
"Cannot connect to MinerU service" — Verify MINERU_API_URL is reachable: curl $MINERU_API_URL/health. In stdio mode, environment variables must be set in the MCP config env field; shell export won't work.
Large files timeout — Increase MINERU_API_TIMEOUT or narrow the start_page_id/end_page_id range to parse in batches.
Want JSON instead of ZIP — Set response_format_zip to false; results will be saved as .json instead of .zip.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mineru_docparse_mcp-1.0.0.tar.gz.
File metadata
- Download URL: mineru_docparse_mcp-1.0.0.tar.gz
- Upload date:
- Size: 4.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2b0602bda454feba9d3e4ffe5088873841680d06fb78a2c13272d27184f697d
|
|
| MD5 |
772d7fc769c706098cc78c3f3f3efda2
|
|
| BLAKE2b-256 |
2d3474c5c067e01717e18d36c8fc200bf8839ef756afede61628af15f0779411
|
Provenance
The following attestation bundles were made for mineru_docparse_mcp-1.0.0.tar.gz:
Publisher:
publish.yml on zhengjie9510/mineru-docparse-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mineru_docparse_mcp-1.0.0.tar.gz -
Subject digest:
f2b0602bda454feba9d3e4ffe5088873841680d06fb78a2c13272d27184f697d - Sigstore transparency entry: 2138157503
- Sigstore integration time:
-
Permalink:
zhengjie9510/mineru-docparse-mcp@68abc7deb3665e4a2021dc64127203b5c878ec7b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/zhengjie9510
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@68abc7deb3665e4a2021dc64127203b5c878ec7b -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file mineru_docparse_mcp-1.0.0-py3-none-any.whl.
File metadata
- Download URL: mineru_docparse_mcp-1.0.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f609fbe470df66fd77723bfde8db4669793e70fdfb9ac2c273ea19edf87554c
|
|
| MD5 |
ddf47b20fa6f2c8f67c44885a383a2f3
|
|
| BLAKE2b-256 |
ff3da4680ad6665625f858b404b8a811c8ec2ffe12e730977a16b7d6480a4669
|
Provenance
The following attestation bundles were made for mineru_docparse_mcp-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on zhengjie9510/mineru-docparse-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mineru_docparse_mcp-1.0.0-py3-none-any.whl -
Subject digest:
3f609fbe470df66fd77723bfde8db4669793e70fdfb9ac2c273ea19edf87554c - Sigstore transparency entry: 2138157514
- Sigstore integration time:
-
Permalink:
zhengjie9510/mineru-docparse-mcp@68abc7deb3665e4a2021dc64127203b5c878ec7b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/zhengjie9510
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@68abc7deb3665e4a2021dc64127203b5c878ec7b -
Trigger Event:
workflow_dispatch
-
Statement type: