PDF Processor MCP server

Extracts text content and mathematical equations from PDF documents using PyMuPDF for text processing and pix2tex for LaTeX OCR, enabling analysis of academic papers and technical documents with specialized equation recognition.
Back to servers
Provider
Michael Levinson
Release date
Jun 08, 2025
Language
Python
Stats
1 star

The PDF Processor MCP Server enables Claude to fetch, process, and extract information from PDF documents, including LaTeX mathematical equations. It provides robust PDF handling capabilities through a Model Context Protocol server, making it easy to integrate with Claude AI assistants.

Features

  • PDF fetching from URLs
  • Text extraction from PDFs
  • LaTeX equation recognition and extraction
  • Integration with Claude via MCP

Installation Options

Standard Installation

pip install -e .

Installing for Claude Desktop/Claude Code

To use this MCP server with Claude Desktop or Claude Code:

  1. Install the MCP CLI tools if not already installed:

    pip install "mcp[cli]"
    
  2. Install the server using the MCP CLI tool:

    mcp install /path/to/pdf_tool_server.py --with-editable /path/to/mcp_pdf_processor
    

    For example, if you've cloned this repository to ~/mcp_pdf_processor:

    mcp install ~/mcp_pdf_processor/pdf_tool_server.py --with-editable ~/mcp_pdf_processor
    
  3. For development with the MCP Inspector:

    mcp dev /path/to/pdf_tool_server.py --with-editable /path/to/mcp_pdf_processor
    

Running the Server

Standalone Mode

To run the server independently:

python pdf_tool_server.py

Environment Variables

You can configure the server with these environment variables:

  • OUTPUT_DIR: Directory to store processed PDFs (default: llm_output)
  • PYTHONPATH: Set to the directory containing the mcp_pdf_processor package

Using with Claude

Claude Desktop Commands

When properly installed, you can use these commands in Claude Desktop:

/mcp PDF_TOOLS fetch_pdf url=https://example.com/document.pdf
/mcp PDF_TOOLS process_pdf hash_id=<HASH_ID> extract_latex=true
/mcp PDF_TOOLS read_processed_pdf filename=<FILENAME>

Conversational Usage

You can also ask Claude to:

  • "Fetch and analyze the PDF at [URL]"
  • "Extract LaTeX equations from the PDF at [URL]"
  • "Summarize the content of the PDF at [URL]"

Complete Workflow Example

Here's a step-by-step workflow for using the PDF processor with Claude Desktop:

# 1. Fetch a PDF without reading it
/mcp PDF_TOOLS fetch_pdf url=https://arxiv.org/pdf/2505.05522

# This returns a hash_id, which you'll use in the next step

# 2. Process the PDF with LaTeX extraction
/mcp PDF_TOOLS process_pdf hash_id=<HASH_ID> extract_latex=true

# This returns a filename for the processed output

# 3. Read the processed content
/mcp PDF_TOOLS read_processed_pdf filename=<FILENAME>

# Now Claude can analyze the PDF content, including any LaTeX equations

Requirements

The server requires these main dependencies:

  • Python 3.9 or higher
  • pymupdf: PDF processing and text extraction
  • mcp: Model Context Protocol support
  • pydantic: Data validation and serialization
  • aiohttp: Asynchronous HTTP client/server
  • torch: For LaTeX equation extraction (optional)
  • pix2tex: For LaTeX equation recognition (optional)

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later