pdf-mcp
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-mcp Summarize the technical specifications from pages 3 to 5 of datasheet.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-mcp
An MCP server for reading, rendering, and searching PDF files. Built with PyMuPDF 2.
Designed for use with LLMs that need to read datasheets and other PDFs containing diagrams, tables, and technical content.
Tools
Tool | Description |
| Get metadata about a PDF (page count, author, title, etc.) |
| Get the outline/bookmarks with page numbers for each section |
| Extract text from a page range in |
| Render a single page as a PNG image, returned as base64 or written to a temp file. Configurable DPI (default 150) |
| Case-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.
Related MCP server: MCP PDF Reader
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-mcpAvailable Tools
5 toolsget_page_imageA
Render a single PDF page as a PNG image.
Args:
filename: Path to a PDF file.
page: Page number (1-indexed).
dpi: Image resolution. Default 150 (good balance of readability and size).
output: "base64" returns the image inline as MCP image content.
"file" writes to a temp file and returns the path.
Inputs: filename (required), page, dpi, output.
get_page_textA
Extract text content from one or more PDF pages.
Args:
filename: Path to a PDF file.
start_page: First page number (1-indexed, inclusive).
end_page: Last page number (1-indexed, inclusive). Defaults to start_page.
format: Output format. "json" returns structured page data with block/line/span
detail. "text" returns plain text. "markdown" returns markdown via
PyMuPDF4LLM. "html" returns HTML.
include_headers_footers: If False, crops top/bottom margins to exclude
headers and footers. Default True.
Inputs: filename (required), start_page, end_page, format, +1 more. Returns: result
get_pdf_infoB
Get metadata and basic info about a PDF file.
Args:
filename: Path to a PDF file.
Inputs: filename (required).
get_table_of_contentsA
Get the table of contents (bookmarks/outline) from a PDF.
When max_level is not specified and the TOC is very large, the depth is automatically
reduced to keep the response manageable. The response will include an
``auto_trimmed_to_level`` field and a hint when this happens.
Args:
filename: Path to a PDF file.
parent: Return only children of the entry whose title contains this string
(case-insensitive). For example, pass a chapter title to get its sections.
max_level: Only include entries up to this depth (1=chapters only, 2=sections, etc.).
When used with parent, levels are relative: 1 means direct children only,
2 means children and grandchildren, etc.
Inputs: filename (required), parent, max_level.
search_textA
Search for text in a PDF file (case-insensitive).
Returns a list of hits with page number and surrounding context.
Args:
filename: Path to a PDF file.
query: Text to search for.
context_chars: Characters of context to include around each hit. Default 100.
Inputs: filename (required), query (required), context_chars. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose with no overlap: get_page_image renders visual content, get_page_text extracts textual content, get_pdf_info provides metadata, get_table_of_contents retrieves structural outline, and search_text performs text search. The descriptions reinforce these distinct functions, making tool selection unambiguous.
All tools follow a consistent verb_noun pattern with 'get_' or 'search_' prefixes (get_page_image, get_page_text, get_pdf_info, get_table_of_contents, search_text). The naming convention is perfectly uniform across all five tools, using snake_case throughout without any deviations.
Five tools is well-scoped for a PDF processing server, covering core operations without bloat. Each tool serves a specific, essential function (rendering, text extraction, metadata, navigation, and search), making the count appropriate and efficient for the domain.
The toolset covers most fundamental PDF operations well, including reading, extracting, navigating, and searching. A minor gap exists in write/modify operations (e.g., merging, splitting, or annotating PDFs), but the provided tools are sufficient for common agent workflows involving PDF analysis and content retrieval.
Maintenance
Related MCP Connectors
Hosted MCP server: convert PDFs to clean, LLM-ready Markdown with tables, formulas and OCR.
MCP server for detecting and redacting PII (Personally Identifiable Information) in PDF documents.
Document-to-Markdown MCP server — convert PDF, Office and HTML into LLM-ready Markdown.
Related MCP Servers
- AlicenseAqualityFmaintenanceAn MCP server that exports PDF documents to markdown format optimized for LLM processing.11BSD 3-Clause
- AlicenseAqualityDmaintenanceAn MCP server that enables AI assistants to read, search, and analyze PDF files from local paths or URLs. It provides tools for extracting specific page ranges, searching for terms, and retrieving document metadata.439 npm1MIT
- AlicenseNot gradedqualityBmaintenanceMCP server that reads PDFs and exposes them as structured Markdown, metadata, outlines, images, and tables to LLM consumers via tools like pdf_read_markdown and pdf_info.Apache 2.0
- FlicenseNot gradedqualityDmaintenanceA local MCP server that extracts text-layer content from PDF files, enabling AI agents to inspect, extract text, outlines, and page content.-