PDF Extraction MCP Server (Claude Code Fork)

by xraywu

31 597 downloads Not rated yet
GitHub

About

MCP server to extract contents from a PDF file

Explore

- Extracts text from local PDF files
- Supports OCR for scanned documents
- Optional page selection with comma-separated numbers
- Supports negative indexing (e.g., -1 for last page)
- Fixed for Claude Code CLI installation
- Runnable as a Python module via python -m pdf_extraction

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name PDF Extraction MCP Server (Claude Code Fork)
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

- Python 3.11 or higher
- pip or conda
- Claude Code CLI installed (claude command)


pip install -e .

which pdf-extraction

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"


If pip install -e . fails:
1. Make sure you have Python 3.11+: python --version
2. Try creating a fresh virtual environment:
bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -e .
```

The server implements one tool:
- extract-pdf-contents: Extract contents from a local PDF file
- Takes pdf_path as a required string argument (local file path)
- Takes pages as an optional string argument (comma-separated page numbers, supports negative indexing like -1 for last page)
- Supports both PDF text extraction and OCR for scanned documents

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "pdf extraction mcp server (claude code fork)": {
            "mcp-pdf-extraction-server": {
                "command": "python",
                "args": [
                    "-m",
                    "venv",
                    "venv"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-pdf-extraction-server": {
        "command": "python",
        "args": [
            "-m",
            "venv",
            "venv"
        ]
    }
}

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

1. Added __main__.py - Enables the package to be run as a module with python -m pdf_extraction
2. Claude Code specific instructions - Clear installation steps that work with Claude Code CLI
3. Tested installation process - Verified working with claude mcp add command

Components

Tools

The server implements one tool:
- extract-pdf-contents: Extract contents from a local PDF file
- Takes pdf_path as a required string argument (local file path)
- Takes pages as an optional string argument (comma-separated page numbers, supports negative indexing like -1 for 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 (claude command)

Step 1: Clone and Install

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.