mineru-selfhosted-mcp
mineru-selfhosted-mcp exposes a self-hosted MinerU service as an MCP server.
It is designed for setups where:
- MinerU is deployed on a remote GPU server
- Claude Desktop / Cursor / other MCP clients run elsewhere
- The client should only run a lightweight MCP bridge locally
Environment variables
MINERU_BASE_URL: Optional. Base URL of your self-hosted MinerU API. Defaults to the public FRP endpointhttp://42.51.34.112:8191MINERU_API_KEY: Optional token sent to the MinerU API asAuthorization: Bearer <token>MINERU_TIMEOUT: Optional request timeout in seconds. Default:1800MINERU_TRUST_ENV: Optional. Set totrueonly if you want the bridge to inherit local proxy variables. Default: disabled.MINERU_LOG_DIR: Optional. Directory used byclean_logs. Defaults to~/.mineru-selfhosted-mcp/logsMINERU_DOWNLOAD_PUBLISH_DIR: Optional. Directory used for published download artifacts. Defaults to/data/mineru_output/_publishedMINERU_DOWNLOAD_BASE_URL: Optional. Public base URL for published artifacts. Defaults to<MINERU_BASE_URL>/downloadsMINERU_ZIP_TTL_SECONDS: Optional. Temporary ZIP lifetime before cleanup. Defaults to10800seconds (3 hours).MINERU_MCP_TRANSPORT: Optional.stdiofor local clients orhttpfor a Linux-hosted remote MCP service. Default:stdioMINERU_MCP_HOST: Optional bind host for HTTP MCP mode. Default:0.0.0.0MINERU_MCP_PORT: Optional bind port for HTTP MCP mode. Default:8001MINERU_UPLOAD_ROOT: Optional. Directory used for staged uploaded source files. Defaults to/data/mineru_uploads
If you are running on the Linux host itself, the local proxy listens on http://127.0.0.1:8192.
Remote MCP clients should use the public FRP endpoint on 8191.
Connection modes
1. Windows local MCP via stdio
Use this when Claude Code, Cursor, or Claude Desktop runs on Windows and only the MinerU API lives on Linux.
- MCP runs locally on Windows
- MinerU API runs remotely on Linux
output_dir,artifact_paths, andzip_pathare Windows-local*_download_urlis convenience-only
2. Linux remote MCP via HTTP
Use this when you want one shared MCP service for many clients and durable public artifact URLs.
- MCP runs on Linux
- MinerU API runs on Linux
/downloadsis served from the same Linux filesystem- Windows clients connect with
type: "http" zip_download_urland other*_download_urlfields become first-class outputs
Exposed tools
mineru_health: check the remote MinerU APIparse_document: parse a single local file through the remote MinerU APIparse_documents: parse one or more local files through the remote MinerU APIparse_directory: parse all matching PDFs in a directory through the remote MinerU APIcreate_upload_session: create a staged upload session for a client-side fileappend_upload_chunk: append a base64 chunk into an upload sessionfinalize_upload: validate and finalize an uploaded staged fileparse_staged_file: parse a finalized staged fileparse_inline_document: upload a base64-encoded local file and parse it in one callparse_url_document: fetch a remote URL, stage it on Linux, and parse it in one callcleanup_staged_file: remove a staged upload sessionget_ocr_languages: list common OCR language codes supported by MinerUclean_logs: remove local MCP log files older than a chosen number of days
Parsing result metadata
Parsing tools also return:
download_urlzip_pathzip_download_urlelapsed_secondsfile_countcompleted_countfailed_countprogress
progress is a stable completion summary for the current call rather than a live streaming progress feed.
parse_document, parse_documents, parse_directory, and submit_parse_task require local absolute file paths plus an explicit output_dir. They default to return_md=true, return_images=true, formula_enable=true, table_enable=true, parse_method="auto", inline_content=false, and response_format_zip=true.
ZIP results are cleaned before publication: only Markdown files and images/ contents are retained. middle_json, model_output, .cache/, raw model traces, and other intermediate files are removed from the downloadable ZIP. Temporary ZIPs are scheduled for deletion after 3 hours by default.
For batch calls with more than 3 files, inline_content is forced to false to protect MCP context size.
Notes
- To get only
middle_json, setmiddle_json_only=truein parsing tools. middle_json_only=trueautomatically disables markdown in the MCP request wrapper.- For Windows -> Linux file transfer through MCP, use
create_upload_session,append_upload_chunk,finalize_upload, thenparse_staged_file. - For simpler one-shot flows, use
parse_inline_documentfor local bytes orparse_url_documentfor remote links.
Example MCP config
{
"mcpServers": {
"mineru-selfhosted": {
"command": "uvx",
"args": ["-y", "mineru-selfhosted-mcp"],
"env": {
"MINERU_API_KEY": "your_token",
"MINERU_BASE_URL": "http://42.51.34.112:8191",
"MINERU_DOWNLOAD_BASE_URL": "http://42.51.34.112:8191/downloads"
}
}
}
}
Example remote HTTP MCP server
Run this on the Linux host:
MINERU_API_KEY=<TOKEN> \
MINERU_BASE_URL=http://127.0.0.1:8192 \
MINERU_MCP_TRANSPORT=http \
MINERU_MCP_HOST=0.0.0.0 \
MINERU_MCP_PORT=8001 \
MINERU_DOWNLOAD_PUBLISH_DIR=/data/mineru_output/_published \
MINERU_DOWNLOAD_BASE_URL=http://42.51.34.112:8191/downloads \
uvx -y mineru-selfhosted-mcp
Then expose the MCP endpoint through nginx or another reverse proxy, for example:
- MCP endpoint:
http://42.51.34.112:8191/mcp/ - downloads base:
http://42.51.34.112:8191/downloads/
Example Windows Claude Code config for remote HTTP MCP
{
"mcpServers": {
"mineru-selfhosted": {
"type": "http",
"url": "http://42.51.34.112:8191/mcp/"
}
}
}
Metadata
Release files for mineru-selfhosted-mcp 0.1.17
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mineru_selfhosted_mcp-0.1.17.tar.gz | 91.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mineru_selfhosted_mcp-0.1.17-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 104.3 kB
Release files / mineru_selfhosted_mcp-0.1.17.tar.gz
| Download URL | mineru_selfhosted_mcp-0.1.17.tar.gz |
|---|---|
| Size | 91.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
468a1cf2e5da66a23379e3739dd94d5c501e8d8ff40f5f970ca3f176984a4e6f
|
|
BLAKE2b-256 checksum How to use checksums |
302dbe482e949baca2c726a7f19ce7723f981ff22695b6247d6e96f3e06f5674
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Release files / mineru_selfhosted_mcp-0.1.17-py3-none-any.whl
| Download URL | mineru_selfhosted_mcp-0.1.17-py3-none-any.whl |
|---|---|
| Size | 12.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
218c1be337bd3f1359aaff0278aa0544a04e8c035111ced8af9240b59a47be31
|
|
BLAKE2b-256 checksum How to use checksums |
db4def4fd48d78348e47333f8e3bd2ab33f01db677b015feec382fb8f004b05d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Security for mineru-selfhosted-mcp 0.1.17
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.