Sandbox
@I-CAN-hack/pdf-mcp

MCP server for reading and searching PDF files

pdf-mcp connects an agent to PDF files through MCP. It can read metadata, extract page text in several formats, render page images, and search across the whole document. The server is stateless, so each request passes the PDF filename directly.

77 stars12 forksPythonUpdated 1mo ago
Who it's for

Builders who want their agent to inspect datasheets, manuals, and other technical PDFs.

What it delivers

You can ask an agent to read, search, and render PDFs instead of opening them yourself.

What it does

PDF metadata lookup

Returns page count, author, title, and other file details with `get_pdf_info`.

Table of contents extraction

Pulls the outline and page numbers for each section with `get_table_of_contents`.

Page text extraction

Extracts page ranges as JSON, text, markdown, or HTML, with an option to skip headers and footers.

Page image rendering

Renders a single page as a PNG image, returned as base64 or written to a temp file, with configurable DPI.

Full-document text search

Searches case-insensitively across the PDF and returns matching page numbers plus surrounding context.

README

pdf-mcp

An MCP server for reading, rendering, and searching PDF files. Built with PyMuPDF and PyMuPDF4LLM.

Designed for use with LLMs that need to read datasheets and other PDFs containing diagrams, tables, and technical content.

Tools

ToolDescription
get_pdf_infoGet metadata about a PDF (page count, author, title, etc.)
get_table_of_contentsGet the outline/bookmarks with page numbers for each section
get_page_textExtract text from a page range in json (default), text, markdown, or html format. Optionally exclude headers/footers
get_page_imageRender a single page as a PNG image, returned as base64 or written to a temp file. Configurable DPI (default 150)
search_textCase-insensitive text search across the entire PDF, returning page numbers and surrounding context

All requests are stateless and take the PDF filename as a parameter.

Setup

Add the following to your .mcp.json:

{
  "mcpServers": {
    "pdf-mcp": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/I-CAN-hack/pdf-mcp.git", "pdf-mcp"]
    }
  }
}

Or for codex run codex mcp add pdf-mcp -- uvx --from git+https://github.com/I-CAN-hack/pdf-mcp.git pdf-mcp.

This will automatically install and run the server using uvx.

Development

# Install dependencies
uv sync

# Generate test PDFs
uv run python assets/generate.py

# Run tests
uv run pytest tests/ -v

# Run the server locally
uv run pdf-mcp

Files in the repo

Repository payload11 top-level entries
  • .github
  • assets
  • src
  • tests
  • .gitignore
  • .mcp.json
  • .python-version
  • LICENSE
  • pyproject.toml
  • README.md
  • uv.lock

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More connectors

Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface

86k

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

43k

Universal provider proxy for OpenAI Codex & Claude Code — use any LLM (Claude, Gemini, Grok, DeepSeek, Ollama…) with Codex CLI, App, SDK, and Claude Code

14k
okf-memory/
okf-agent-memory

Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.

547
tirth8205/
code-review-graph

Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.

31k
2akouwu/
reverify

Stop your AI from making things up — it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.

1.1k