PDF Extraction MCP Server
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., "@PDF Extraction MCP Server extract text from the PDF at /documents/report.pdf"
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.
PDF Extraction MCP Server (Claude Code Fork)
MCP server to extract contents from PDF files, with fixes for Claude Code CLI installation.
This fork includes critical fixes for installing and running the server with Claude Code (the CLI version).
What's Different in This Fork
Added
__main__.py- Enables the package to be run as a module withpython -m pdf_extractionClaude Code specific instructions - Clear installation steps that work with Claude Code CLI
Tested installation process - Verified working with
claude mcp addcommand
Related MCP server: mcp-pdf-tools
Components
Tools
The server implements one tool:
extract-pdf-contents: Extract contents from a local PDF file
Takes
pdf_pathas a required string argument (local file path)Takes
pagesas an optional string argument (comma-separated page numbers, supports negative indexing like-1for last page)Supports both PDF text extraction and OCR for scanned documents
Installation for Claude Code CLI
Prerequisites
Python 3.11 or higher
pip or conda
Claude Code CLI installed (
claudecommand)
Step 1: Clone and Install
# Clone this fork
git clone https://github.com/lh/mcp-pdf-extraction-server.git
cd mcp-pdf-extraction-server
# Install in development mode
pip install -e .Step 2: Find the Installed Command
# Check where pdf-extraction was installed
which pdf-extraction
# Example output: /opt/homebrew/Caskroom/miniconda/base/bin/pdf-extractionStep 3: Add to Claude Code
# Add the server using the full path from above
claude mcp add pdf-extraction /opt/homebrew/Caskroom/miniconda/base/bin/pdf-extraction
# Verify it was added
claude mcp listStep 4: Use in Claude
# Start a new Claude session
claude
# In Claude, type:
/mcp
# You should see:
# MCP Server Status
# • pdf-extraction: connectedUsage Example
Once connected, you can ask Claude to extract PDF contents:
"Can you extract the content from the PDF at /path/to/document.pdf?"
"Extract pages 1-3 and the last page from /path/to/document.pdf"Troubleshooting
Server Not Connecting
Make sure you started a NEW Claude session after adding the server
Verify the command path is correct:
ls -la $(which pdf-extraction)Test the command directly (it should hang waiting for input):
pdf-extraction
Module Not Found Errors
If you get Python import errors:
Make sure you're using the same Python environment where you installed the package
Try using the full Python path:
claude mcp add pdf-extraction /path/to/python -m pdf_extraction
Installation Issues
If pip install -e . fails:
Make sure you have Python 3.11+:
python --versionTry creating a fresh virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -e .
For Claude Desktop Users
This fork is specifically for Claude Code CLI. If you're using Claude Desktop (the GUI app), please refer to the original repository for installation instructions.
Dependencies
mcp>=1.2.0
pypdf2>=3.0.1
pytesseract>=0.3.10 (for OCR support)
Pillow>=10.0.0
pydantic>=2.10.1,<3.0.0
pymupdf>=1.24.0
Contributing
Contributions are welcome! The main change in this fork is the addition of __main__.py to make the package runnable as a module.
License
Same as the original repository.
Credits
Available Tools
1 toolextract-pdf-contentsC
Extract contents from a local PDF file, given page numbers separated in comma. Negative page index number supported.
Inputs: pdf_path (required), pages.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap with other tools. The tool's purpose is clearly defined as extracting contents from PDF files, making it impossible for an agent to confuse it with another tool.
Since there is only one tool, naming consistency is inherently perfect. The tool name 'extract-pdf-contents' follows a clear verb-noun pattern, and there are no other tools to deviate from or conflict with this pattern.
A single tool for a PDF extraction server is too minimal for the apparent scope. While the tool handles content extraction, typical PDF operations like metadata retrieval, text analysis, or format conversion are missing, making the server feel incomplete and underpowered for its domain.
The server is severely incomplete for PDF extraction. It only provides content extraction with page selection, lacking essential operations such as getting metadata, extracting images, converting to other formats, or searching within PDFs. This will likely cause agent failures when broader PDF tasks are required.
Related MCP Connectors
MCP server for detecting and redacting PII (Personally Identifiable Information) in PDF documents.
Hosted MCP server: convert PDFs to clean, LLM-ready Markdown with tables, formulas and OCR.
Document conversion MCP server: PDF to Markdown, image OCR, spreadsheet parsing.
MCP server for the PDFGate API. Generate PDFs, manage documents and handle e-signatures.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn MCP server that provides comprehensive PDF processing capabilities including text extraction, image extraction, table detection, annotation extraction, metadata retrieval, page rendering, and document structure analysis.-
- AlicenseAqualityNot gradedmaintenanceAn MCP server that enables users to read, search, and analyze PDF documents. It provides tools for extracting text, viewing metadata, searching content with context, and generating word statistics.5-
- FlicenseNot gradedqualityDmaintenanceAn MCP server that provides tools for reading, writing, and manipulating PDF files, including text extraction, metadata retrieval, and merging or splitting documents. It also enables users to create PDFs from plain text and convert specific pages or entire documents into images.1-
- FlicenseNot gradedqualityDmaintenanceMCP server for extracting text from PDF files, supporting local files and URLs.-