FutureUnreal mcp pdf2md

FutureUnreal mcp pdf2md avatar

by FutureUnreal

PDF to Markdown conversion tool

What is FutureUnreal mcp pdf2md

MCP-PDF2MD

smithery badge English | 中文

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.

System Requirements

  • Software: Python 3.10+

Quick Start

  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
    

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:

  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.

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:

  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.

Demo

Input PDF

Input PDF

Output Markdown

Output Markdown

License

MIT License - see the LICENSE file for details.

Credits

This project is based on the API from MinerU.

Leave a Comment

Frequently Asked Questions

What is MCP?

MCP (Model Context Protocol) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications, providing a standardized way to connect AI models to different data sources and tools.

What are MCP Servers?

MCP Servers are lightweight programs that expose specific capabilities through the standardized Model Context Protocol. They act as bridges between LLMs like Claude and various data sources or services, allowing secure access to files, databases, APIs, and other resources.

How do MCP Servers work?

MCP Servers follow a client-server architecture where a host application (like Claude Desktop) connects to multiple servers. Each server provides specific functionality through standardized endpoints and protocols, enabling Claude to access data and perform actions through the standardized protocol.

Are MCP Servers secure?

Yes, MCP Servers are designed with security in mind. They run locally with explicit configuration and permissions, require user approval for actions, and include built-in security features to prevent unauthorized access and ensure data privacy.

Related MCP Servers

chrisdoc hevy mcp avatar

chrisdoc hevy mcp

mcp
sylphlab pdf reader mcp avatar

sylphlab pdf reader mcp

An MCP server built with Node.js/TypeScript that allows AI agents to securely read PDF files (local or URL) and extract text, metadata, or page counts. Uses pdf-parse.

pdf-parsetypescriptnodejs
aashari mcp server atlassian bitbucket avatar

aashari mcp server atlassian bitbucket

Node.js/TypeScript MCP server for Atlassian Bitbucket. Enables AI systems (LLMs) to interact with workspaces, repositories, and pull requests via tools (list, get, comment, search). Connects AI directly to version control workflows through the standard MCP interface.

atlassianrepositorymcp
aashari mcp server atlassian confluence avatar

aashari mcp server atlassian confluence

Node.js/TypeScript MCP server for Atlassian Confluence. Provides tools enabling AI systems (LLMs) to list/get spaces & pages (content formatted as Markdown) and search via CQL. Connects AI seamlessly to Confluence knowledge bases using the standard MCP interface.

atlassianmcpconfluence
prisma prisma avatar

prisma prisma

Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB

cockroachdbgomcp
Zzzccs123 mcp sentry avatar

Zzzccs123 mcp sentry

mcp sentry for typescript sdk

mcptypescript
zhuzhoulin dify mcp server avatar

zhuzhoulin dify mcp server

mcp
zhongmingyuan mcp my mac avatar

zhongmingyuan mcp my mac

mcp
zhixiaoqiang desktop image manager mcp avatar

zhixiaoqiang desktop image manager mcp

MCP 服务器,用于管理桌面图片、查看详情、压缩、移动等(完全让Trae实现)

mcp
zhixiaoqiang antd components mcp avatar

zhixiaoqiang antd components mcp

An MCP service for Ant Design components query | 一个减少 Ant Design 组件代码生成幻觉的 MCP 服务,包含系统提示词、组件文档、API 文档、代码示例和更新日志查询

designantdapi

Submit Your MCP Server

Share your MCP server with the community

Submit Now