mcp-pdf2md
Repository hosting for the MCP-PDF2MD service, allowing users to clone and set up the service from GitHub
Automatically recognizes and converts mathematical formulas found in PDF documents to LaTeX format
Converts PDF content to structured Markdown format, preserving document structure including headings, paragraphs, lists, and tables
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-pdf2md convert this PDF file to markdown"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP-PDF2MD
MCP-PDF2MD Service
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.
Key Features
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.
Related MCP server: pdf2md-mcp
System Requirements
Software: Python 3.10+
Quick Start
Clone the repository and enter the directory:
git clone https://github.com/FutureUnreal/mcp-pdf2md.git cd mcp-pdf2mdCreate 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
.envfile 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_hereStart the service:
uv run pdf2md
Command Line Arguments
The server supports the following command line arguments:
Claude Desktop Configuration
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:
In the
.envfile within the project directory (recommended for development)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.
MCP Tools
The server provides the following MCP tools:
convert_pdf_url: Convert PDF URL to Markdown
convert_pdf_file: Convert local PDF file to Markdown
Getting MinerU API Key
This project relies on the MinerU API for PDF content extraction. To obtain an API key:
Visit MinerU official website and register for an account
After logging in, apply for API testing qualification at this link
Once your application is approved, you can access the API Management page
Generate your API key following the instructions provided
Copy the generated API key
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.
Demo
Input PDF

Output Markdown

License
MIT License - see the LICENSE file for details.
Credits
This project is based on the API from MinerU.
Available Tools
2 toolsconvert_pdf_fileC
Convert local PDF file to Markdown, supports single file or file list
Args:
file_path: PDF file local path or path list, can be separated by spaces, commas, or newlines
enable_ocr: Whether to enable OCR (default: True)
Returns:
dict: Conversion result information
Inputs: file_path (required), enable_ocr.
convert_pdf_urlB
Convert PDF URL to Markdown, supports single URL or URL list
Args:
url: PDF file URL or URL list, can be separated by spaces, commas, or newlines
enable_ocr: Whether to enable OCR (default: True)
Returns:
dict: Conversion result information
Inputs: url (required), enable_ocr.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: one handles local file paths, the other handles URLs. The naming and descriptions make it impossible to confuse which tool to use for a given input source.
Both tools follow an identical verb_noun pattern (convert_pdf_file and convert_pdf_url) with consistent snake_case formatting. The naming is perfectly predictable across the toolset.
With only two tools, the server feels minimal but functional. While it covers the core conversion task for both local files and URLs, the count is borderline thin for a PDF-to-Markdown domain that could potentially include more operations like batch processing, format options, or metadata extraction.
The server covers the essential conversion operation for both local files and remote URLs, which are the two main input sources for PDFs. The minor gap is the lack of additional PDF manipulation or output customization tools, but agents can perform basic conversions without dead ends.
Maintenance
Related MCP Connectors
PDF to Markdown and PDF to text from PDF URLs, page by page, with OCR for scanned pages
PDF, Word, PowerPoint, Excel, HTML, EPUB to Markdown: OCR, page ranges, tables, RAG chunking
Extract text and metadata from PDFs; convert Markdown or text to PDF
Documents to Markdown: PDF, DOCX, PPTX, XLSX, HTML. Scanned PDF pages read by AI.
Related MCP Servers
- AlicenseAqualityDmaintenanceConverts various file types and web content to Markdown format. It provides a set of tools to transform PDFs, images, audio files, web pages, and more into easily readable and shareable Markdown text.10581 npm3,001MIT
- AlicenseNot gradedqualityDmaintenanceConverts PDF files to Markdown format using AI sampling capabilities.MIT
- AlicenseNot gradedqualityDmaintenanceConverts markdown files into professional PDF documents with automatic table of contents and interactive navigation.8MIT
- AlicenseNot gradedqualityDmaintenanceConvert PDF documents to Markdown and query them using AI with source attribution and confidence scoring, supporting multiple LLM providers.MIT