PDF Extraction Claude
STDIOMCP server to extract contents from a PDF file.
MCP server to extract contents from a PDF file.
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).
__main__.py
- Enables the package to be run as a module with python -m pdf_extraction
claude mcp add
commandThe server implements one tool:
pdf_path
as a required string argument (local file path)pages
as an optional string argument (comma-separated page numbers, supports negative indexing like -1
for last page)claude
command)# 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 .
# Check where pdf-extraction was installed which pdf-extraction # Example output: /opt/homebrew/Caskroom/miniconda/base/bin/pdf-extraction
# 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 list
# Start a new Claude session claude # In Claude, type: /mcp # You should see: # MCP Server Status # • pdf-extraction: connected
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"
ls -la $(which pdf-extraction)
pdf-extraction
If you get Python import errors:
claude mcp add pdf-extraction /path/to/python -m pdf_extraction
If pip install -e .
fails:
python --version
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -e .
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.
Contributions are welcome! The main change in this fork is the addition of __main__.py
to make the package runnable as a module.
Same as the original repository.