This MCP-PDF2MD server provides high-performance PDF to Markdown conversion using the MinerU API, supporting both local PDF files and URL links with intelligent structure preservation.
Clone the repository and navigate to the project directory:
git clone https://github.com/FutureUnreal/mcp-pdf2md.git
cd mcp-pdf2md
Create and activate a virtual environment:
Linux/macOS:
uv venv
source .venv/bin/activate
uv pip install -e .
Windows:
uv venv
.venv\Scripts\activate
uv pip install -e .
Configure the MinerU API:
Create a .env
file in the project root with the following content:
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
Add the MCP server configuration to 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"
}
}
}
}
You can configure the API key in either:
.env
file (for development)The configuration in Claude Desktop takes precedence if both are set.
The server provides two main tools:
To obtain the required API key:
Note that MinerU API access requires approval and may take some time to process.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.