
PDF to Markdown
STDIOPDF to Markdown conversion service with structured output and batch processing.
PDF to Markdown conversion service with structured output and batch processing.
An MCP-based high-performance PDF to Markdown conversion service powered by MinerU API, supporting batch processing for local files and URL links with structured output.
Clone the repository and enter the directory:
git clone https://github.com/FutureUnreal/mcp-pdf2md.git cd mcp-pdf2md
Create a virtual environment and install dependencies:
Linux/macOS:
uv venv source .venv/bin/activate uv pip install -e .
Windows:
uv venv .venv\Scripts\activate uv pip install -e .
Configure environment variables:
Create a .env
file in the project root directory and set the following environment variables:
MINERU_API_BASE=https://mineru.net/api/v4/extract/task
MINERU_BATCH_API=https://mineru.net/api/v4/extract/task/batch
MINERU_BATCH_RESULTS_API=https://mineru.net/api/v4/extract-results/batch
MINERU_API_KEY=your_api_key_here
Start the service:
uv run pdf2md
The server supports the following command line arguments:
Add the following configuration in Claude Desktop:
Windows:
{ "mcpServers": { "pdf2md": { "command": "uv", "args": [ "--directory", "C:\\path\\to\\mcp-pdf2md", "run", "pdf2md", "--output-dir", "C:\\path\\to\\output" ], "env": { "MINERU_API_KEY": "your_api_key_here" } } } }
Linux/macOS:
{ "mcpServers": { "pdf2md": { "command": "uv", "args": [ "--directory", "/path/to/mcp-pdf2md", "run", "pdf2md", "--output-dir", "/path/to/output" ], "env": { "MINERU_API_KEY": "your_api_key_here" } } } }
Note about API Key Configuration: You can set the API key in two ways:
.env
file within the project directory (recommended for development)If you set the API key in both places, the one in the Claude Desktop configuration will take precedence.
The server provides the following MCP tools:
This project relies on the MinerU API for PDF content extraction. To obtain an API key:
MINERU_API_KEY
Note that access to the MinerU API is currently in testing phase and requires approval from the MinerU team. The approval process may take some time, so plan accordingly.
MIT License - see the LICENSE file for details.
This project is based on the API from MinerU.