PDF Reader MCP Server
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 Reader MCP Serversearch the user_guide.pdf for warranty information and show me those pages"
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 Reader MCP Server
High-performance, ultra-low-token Model Context Protocol (MCP) server for LLMs and AI coding assistants.
Powered by C-accelerated PyMuPDF and pymupdf4llm for pristine Markdown and table extraction.
๐ฏ Why This MCP Server?
When AI agents (Claude, Gemini, Cursor, Antigravity) process PDFs through native chat uploads, the interface typically converts every page into high-resolution images (Vision) and raw OCR text:
โ ๏ธ Massive Token Waste: A 13-page technical document consumes 30,000โ50,000 tokens. A 370-page service manual easily exceeds 1,000,000+ tokens, blowing past context limits.
โ ๏ธ High Latency: Uploading and parsing takes 15โ40 seconds per interaction.
โ ๏ธ Loss of Formatting: Tables and multi-column layouts frequently lose their structure in raw text extraction.
The Solution: On-Demand Introspection
pdf-reader-mcp allows AI agents to inspect, search, and extract only the specific sections or pages they actually need:
๐ 2.1 seconds to search an entire 373-page automotive technical manual.
๐ 98โ99% token reduction: ~200 tokens per focused query instead of 50,000+.
๐ Table-Aware Markdown: Preserves tables, headers, lists, and code blocks using
pymupdf4llm.
Related MCP server: PDF Splitter MCP Server
๐ ๏ธ Available MCP Tools
Tool | Parameters | Description | Typical Token Cost |
|
| Returns document metadata: page count, size, title, author, encryption status. | ~30 tokens |
|
| Extracts bookmarks and table of contents with hierarchy levels and target pages. | ~100 tokens |
|
| Lightning-fast full-text search across all pages with surrounding context snippets. | ~200 tokens |
|
| Extracts a single target page in clean Markdown or plain text. | ~150โ300 tokens |
|
| Reads an inclusive range of pages formatted as Markdown with page break separators. | Proportional |
๐ฆ Installation
Prerequisites
Python 3.10+ (tested on Python 3.11 and 3.12)
Windows, macOS, or Linux
git clone https://github.com/serresident/pdf-reader-mcp.git
cd pdf-reader-mcp
pip install -r requirements.txtโ๏ธ Configuration
1. Antigravity / Gemini CLI (mcp_config.json)
Add to ~/.gemini/config/mcp_config.json:
{
"mcpServers": {
"pdf-reader-mcp": {
"command": "python",
"args": [
"C:\\Users\\erch\\ะะพะน ะดะธัะบ\\1 for ai\\mcp\\pdf-reader-mcp\\pdf_reader_mcp.py"
]
}
}
}2. Claude Desktop (claude_desktop_config.json)
On Windows: %APPDATA%\Claude\claude_desktop_config.json
On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"pdf-reader": {
"command": "python",
"args": [
"/path/to/pdf-reader-mcp/pdf_reader_mcp.py"
]
}
}
}3. Cursor / Windsurf
Add as a Command (stdio) MCP server in the Settings โ MCP panel:
Command:
pythonArgs:
/absolute/path/to/pdf_reader_mcp.py
๐ How Agents Use It (Workflow)
flowchart TD
User["User asks question about PDF"] --> Agent["AI Agent"]
Agent -->|1. Check pages & size| Info["pdf_info"]
Agent -->|2. Check document structure| TOC["pdf_toc"]
Agent -->|3. Find keywords across 400 pages| Search["pdf_search"]
Search -->|Returns matching pages e.g. p. 36| Match["Target Pages Identified"]
Match -->|4. Read only relevant page| Read["pdf_read_page(36)"]
Read -->|Markdown + Tables| Agent
Agent --> Answer["Fast, accurate answer with zero context bloat!"]๐งช Testing
Run an end-to-end self-test directly in terminal:
python -c "
import subprocess, json
proc = subprocess.Popen(['python', 'pdf_reader_mcp.py'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, text=True, encoding='utf-8')
proc.stdin.write(json.dumps({'jsonrpc': '2.0', 'id': 1, 'method': 'initialize', 'params': {}}) + '\n')
proc.stdin.flush()
print('Server initialized:', proc.stdout.readline())
proc.terminate()
"๐ License
MIT License ยฉ 2026 serresident.
This server cannot be deployed
Maintenance
Related MCP Connectors
High-fidelity PDF to structured Markdown conversion and document field extraction.
Agent-native document parsing: PDF, scans and FR/EU invoices to structured JSON or Markdown.
Generate and read PDFs for AI agents: a generate_pdf and a read_pdf tool, priced per document.
Deterministic PDF tools for AI agents: inspect fields, fill forms, merge PDFs, invoices.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI-driven PDF document processing including PDF to Markdown conversion, intelligent text and table extraction, image extraction, format conversion between PDF/Word/Markdown, batch processing, and fuzzy search - optimized for LLM context and RAG workflows.2MIT
- AlicenseNot gradedqualityDmaintenanceProvides random access to PDF contents with selective page extraction, text search, outline navigation, image extraction, and page rendering capabilities. Reduces token usage by allowing targeted content extraction instead of processing entire documents.4MIT
- AlicenseAqualityCmaintenanceEnables AI agents to efficiently process large local and online PDFs through selective extraction of text, images, and metadata. It provides tools for content search and document outline navigation to optimize context window usage.716ISC
- AlicenseAqualityDmaintenanceEnables AI agents to process and inspect PDFs by detecting document type, extracting text, and generating Markdown with layout information.71MIT