The MCP-PDF2MD service is a high-performance tool designed to convert PDF files into structured Markdown format. It leverages the MinerU API and supports batch processing for both local files and URL links. This service is particularly useful for users who need to maintain document structure while converting PDFs to Markdown.
shell
git clone https://github.com/FutureUnreal/mcp-pdf2md.git
cd mcp-pdf2md
shell
uv venv
source .venv/bin/activate
uv pip install -e .
shell
uv venv
.venv\Scripts\activate
uv pip install -e .
.env
file in the project root directory and set the following 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
shell
uv run pdf2md
Add the following configuration in Claude Desktop:
Windows:
json
{
"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:
json
{
"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"
}
}
}
}
The server provides the following MCP tools:
- convert_pdf_url: Convert PDF URL to Markdown
- convert_pdf_file: Convert local PDF file to Markdown
MIT License - see the LICENSE file for details.
This project is based on the API from MinerU.