MCP bridge for a self-hosted MinerU API
Project description
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_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 files 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 filecleanup_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:
elapsed_secondsfile_countcompleted_countfailed_countprogress
progress is a stable completion summary for the current call rather than a live streaming progress feed.
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.
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/"
}
}
}
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_selfhosted_mcp-0.1.15.tar.gz.
File metadata
- Download URL: mineru_selfhosted_mcp-0.1.15.tar.gz
- Upload date:
- Size: 90.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d25c0be9f0d37a0f51d8a31f1c48e0c5b6552dbbe5d69a0e49e19d037c43ed96
|
|
| MD5 |
07b98a53ba410e1bdfcafb66c3da2def
|
|
| BLAKE2b-256 |
85af8c10d52dfeaa22a25e0490c12adda5e45bb3647da2c36a59cf5f2a789315
|
File details
Details for the file mineru_selfhosted_mcp-0.1.15-py3-none-any.whl.
File metadata
- Download URL: mineru_selfhosted_mcp-0.1.15-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ad3cabd99616aecff4afdad7372c800c31fa0505b9bbbedd2cbac5b2ffafd37
|
|
| MD5 |
946e128ff69738115d33c26f4c5eedae
|
|
| BLAKE2b-256 |
d481990579a30102719bce69807c20a8ea2fb0f6567a84c53f0c186a3f3021ec
|