MCP-PDF2MD
About
Converts PDF documents to Markdown format while preserving document structure, enabling content migration and making PDF content more accessible and editable.
Details
- Author
- futureunreal
- Repository
- FutureUnreal/mcp-pdf2md
- GitHub stars
- 3
- License
- MIT License
- Categories
- Productivity, Other, Developer Tools, Workplace, File Management, AI, Security, API, Knowledge Base
- Tags
- #document, #file-conversion, #pdf, #integration
Jump to
- Format Conversion: Convert PDF files to structured Markdown format.
- Multi-source Support: Process both local PDF files and URL links.
- Intelligent Processing: Automatically select the best processing method.
- Batch Processing: Support multi-file batch conversion for efficient handling of large volumes of PDF files.
- MCP Integration: Seamless integration with LLM clients like Claude Desktop.
- Structure Preservation: Maintain the original document structure, including headings, paragraphs, lists, etc.
- Smart Layout: Output text in human-readable order, suitable for single-column, multi-column, and complex layouts.
- Formula Conversion: Automatically recognize and convert formulas in the document to LaTeX format.
- Table Extraction: Automatically recognize and convert tables in the document to structured format.
- Cleanup Optimization: Remove headers, footers, footnotes, page numbers, etc., to ensure semantic coherence.
- High-Quality Extraction: High-quality extraction of text, images, and layout information from PDF documents.
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
MCP-PDF2MDCommand (node, npx, python, etc.)uvArguments-
Argument 1
--directory -
Argument 2
/path/to/mcp-pdf2md -
Argument 3
run -
Argument 4
pdf2md -
Argument 5
--output-dir -
Argument 6
/path/to/output
Environment-
MINERU_API_KEY
your_api_key_here
Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
-
Argument 1
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
1. Clone the repository and enter the directory:
git clone https://github.com/FutureUnreal/mcp-pdf2md.git
cd mcp-pdf2md
2. 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 .
3. 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
4. Start the service:
uv run pdf2md
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:
1. In the .env file within the project directory (recommended for development)
2. In the Claude Desktop configuration as shown above (recommended for regular use)
If you set the API key in both places, the one in the Claude Desktop configuration will take precedence.
This project relies on the MinerU API for PDF content extraction. To obtain an API key:
1. Visit MinerU official website and register for an account
2. After logging in, apply for API testing qualification at this link
3. Once your application is approved, you can access the API Management page
4. Generate your API key following the instructions provided
5. Copy the generated API key
6. Use this string as the value for 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.
convert_pdf_url
Convert a PDF URL to Markdown format.
convert_pdf_file
Convert a local PDF file to Markdown format.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"mcp-pdf2md": {
"env": {
"MINERU_API_KEY": "your_api_key_here"
},
"args": [
"--directory",
"/path/to/mcp-pdf2md",
"run",
"pdf2md",
"--output-dir",
"/path/to/output"
],
"command": "uv"
}
}
}
Linux
{
"env": {
"MINERU_API_KEY": "your_api_key_here"
},
"args": [
"--directory",
"/path/to/mcp-pdf2md",
"run",
"pdf2md",
"--output-dir",
"/path/to/output"
],
"command": "uv"
}
Macos
{
"env": {
"MINERU_API_KEY": "your_api_key_here"
},
"args": [
"--directory",
"/path/to/mcp-pdf2md",
"run",
"pdf2md",
"--output-dir",
"/path/to/output"
],
"command": "uv"
}
Windows
{
"env": {
"MINERU_API_KEY": "your_api_key_here"
},
"args": [
"--directory",
"C:\\path\\to\\mcp-pdf2md",
"run",
"pdf2md",
"--output-dir",
"C:\\path\\to\\output"
],
"command": "uv"
}
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.




