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.
pip install -e .
To use this MCP server with Claude Desktop or Claude Code:
Install the MCP CLI tools if not already installed:
pip install "mcp[cli]"
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
For development with the MCP Inspector:
mcp dev /path/to/pdf_tool_server.py --with-editable /path/to/mcp_pdf_processor
To run the server independently:
python pdf_tool_server.py
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 packageWhen 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>
You can also ask Claude to:
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
The server requires these main dependencies:
pymupdf
: PDF processing and text extractionmcp
: Model Context Protocol supportpydantic
: Data validation and serializationaiohttp
: Asynchronous HTTP client/servertorch
: For LaTeX equation extraction (optional)pix2tex
: For LaTeX equation recognition (optional)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.
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"
]
}
}
}
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.
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.