MCP-PDF2MD logo

MCP-PDF2MD

Community
FutureUnreal

PDF to Markdown conversion tool

PublisherFutureUnreal
Repositorymcp-pdf2md
LanguagePython
Forks
9
Stars
35
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    MCP-PDF2MD exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    35 stars and 9 forks from the linked repository.

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:

    bash
    git clone https://github.com/FutureUnreal/mcp-pdf2md.git
    cd mcp-pdf2md
  2. Create a virtual environment and install dependencies:

    Linux/macOS:

    bash
    uv venv
    source .venv/bin/activate
    uv pip install -e .

    Windows:

    bash
    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:

    bash
    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:

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"
            }
        }
    }
}

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.

Installation

TypingMind
{
  "mcpServers": {
    "mcp-pdf2md": {
      "command": "uv",
      "args": [
        "run",
        "pdf2md"
      ],
      "env": {
        "MINERU_API_KEY": "<MINERU_API_KEY>"
      }
    }
  }
}

Use MCP-PDF2MD MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once MCP-PDF2MD is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add MCP-PDF2MD as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the MCP-PDF2MD MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "mcp-pdf2md": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the MCP-PDF2MD MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the MCP-PDF2MD MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use MCP-PDF2MD to help me with this task?
MCP-PDF2MD
Sure. I read it.
Here is what I found using MCP-PDF2MD.

Frequently asked questions

What is the MCP-PDF2MD MCP server used for?

MCP-PDF2MD is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use MCP-PDF2MD MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use MCP-PDF2MD with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use MCP-PDF2MD MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With MCP-PDF2MD connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect MCP-PDF2MD MCP to TypingMind?

MCP-PDF2MD runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does MCP-PDF2MD MCP provide in TypingMind?

MCP-PDF2MD exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use MCP-PDF2MD MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If MCP-PDF2MD requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇