Skip to main content

MCP server exposing the PDF Extractor API as tools.

Project description

PDF Extractor MCP Server

A Model Context Protocol server that exposes the PDF Extractor API as tools so that LLM agents (Claude Desktop, Claude Code, Cursor, etc.) can extract images, tables, text blocks, formulas, and other elements from PDF documents.

Tools

Tool Description
extract_elements Extract elements from a single PDF (path, URL, or base64).
extract_elements_batch Extract elements from multiple PDFs (Business tier).
list_extractions Paginate the authenticated user's past extraction jobs.
get_extraction Fetch details and files for a specific extraction.
delete_extraction Delete an extraction job.
download_file Fetch (and optionally save) a presigned Files[].Url from an extraction.

Install

Requires Python 3.10+. Pick whichever fits your workflow:

# Zero local setup — recommended for end users
uvx pdf-extractor-mcp

# Or a persistent install
pipx install pdf-extractor-mcp

# Or from source (for development)
cd mcp_server
python -m pip install -e ".[dev]"

Configure

Generate an API token at https://www.pdf-xtract.com/account/tokens and export it before running the server:

export PDF_EXTRACTOR_API_KEY=pxt_...
# Optional: point at a self-hosted deployment
# export PDF_EXTRACTOR_API_URL=https://pdf.example.com

Run

pdf-extractor-mcp
# or
python -m pdf_extractor_mcp

The server speaks MCP over stdio.

Claude Desktop / Claude Code config

Add this to claude_desktop_config.json (or your IDE's MCP settings). With uvx the package is fetched and cached on first run, so users don't need a prior pip install:

{
  "mcpServers": {
    "pdf-extractor": {
      "command": "uvx",
      "args": ["pdf-extractor-mcp"],
      "env": {
        "PDF_EXTRACTOR_API_KEY": "pxt_..."
      }
    }
  }
}

If you installed via pipx, replace "command": "uvx", "args": [...] with "command": "pdf-extractor-mcp".

Element categories

Caption, Footnote, Expression, Entry, Footer, Header, Image, SectionTitle, Table, Text, Title. Defaults to ["Image"].

Example prompts

  • "Extract all tables from ~/Downloads/report.pdf as PNG and summarize the first one."
  • "Pull every figure caption from pages 5-12 of https://arxiv.org/pdf/2401.12345.pdf."
  • "List my extractions from the last week."

Testing the server

Three ways to exercise the server without a full IDE round-trip:

  1. MCP Inspector (interactive UI):

    npx @modelcontextprotocol/inspector pdf-extractor-mcp
    

    Lists every tool, lets you fill in arguments, and shows the live response.

  2. stdio smoke test — confirms the binary starts and registers tools:

    echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' \
      | pdf-extractor-mcp
    
  3. Unit tests (no network, no API key required):

    cd mcp_server
    pip install -e ".[dev]"
    pytest -m "not integration"
    

    An opt-in integration test exercises the live API; set a real key and run:

    PDF_EXTRACTOR_API_KEY=pxt_... pytest -m integration
    

Releasing

The MCP server is published to PyPI as pdf-extractor-mcp from the .github/workflows/mcp-server-release.yml workflow. To cut a release:

  1. Bump version in mcp_server/pyproject.toml.
  2. Tag the commit: git tag mcp-v0.1.0 && git push origin mcp-v0.1.0.
  3. The workflow builds the sdist + wheel and publishes via PyPI Trusted Publishing (OIDC — no API token stored). The PyPI project and GitHub OIDC binding need to be configured once by the project owner.

Notes

  • Pass store_file=true (the default) for large PDFs - the API returns presigned URLs instead of base64 blobs. Use download_file to fetch them.
  • When store_file=false, the server truncates FileData in its response summary and adds FileDataLength; the raw base64 stays available by calling the API directly if needed.
  • OCR (ocr_mode=element|page) requires Starter or Business tier.
  • Batch extraction requires Business tier.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pdf_extractor_mcp-0.1.0.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pdf_extractor_mcp-0.1.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file pdf_extractor_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: pdf_extractor_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pdf_extractor_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 aab438f57fde38bebfb2c47b12f2fa442c972d95a813bab5b7d3fa1731048b99
MD5 ca72e8839ee21b721210be0bef824501
BLAKE2b-256 85adf982dfe13aec95257a501a55afab0a16aeecccb993ffe931b7e902925375

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdf_extractor_mcp-0.1.0.tar.gz:

Publisher: mcp-server-release.yml on BorisBesky/pdf-extractor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pdf_extractor_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pdf_extractor_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4cb05cc2e74e691f0833d8d392599f9d4f99ddd3070365cce62fa3a9402159ba
MD5 10695ba5a8f58792d8ce4548148aec0c
BLAKE2b-256 31f0f5696a464af12c826a6427248be4a4e012ab0c1b20815a50630460338a40

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdf_extractor_mcp-0.1.0-py3-none-any.whl:

Publisher: mcp-server-release.yml on BorisBesky/pdf-extractor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page