PDF Reader
Read text, metadata, and page count from PDF files securely within the project context.
PDF Reader MCP β‘
The fastest and most powerful PDF processing server for AI agents
5-10x faster parallel processing β’ Y-coordinate content ordering β’ 94%+ test coverage β’ Production-ready
π Overview
PDF Reader MCP is a production-ready Model Context Protocol server that empowers AI agents with enterprise-grade PDF processing capabilities. Extract text, images, and metadata with unmatched performance and reliability.
Stop struggling with PDF extraction. Choose PDF Reader MCP.
β‘ Why PDF Reader MCP?
Unmatched Performance
- π 5-10x faster than sequential processing with automatic parallelization
- π₯ Process 50-page PDFs in seconds with multi-core utilization
- β‘ ~12,933 ops/sec error handling, ~5,575 ops/sec text extraction
- π¨ Streaming support for efficient large file handling
- π¦ Lightweight with minimal dependencies
Developer Experience
- π― Path Flexibility - Absolute & relative paths, Windows/Unix support (NEW v1.3.0)
- πΌοΈ Smart Ordering - Y-coordinate based content extraction preserves layout
- π‘οΈ Type Safe - Full TypeScript with strict mode enabled
- π Battle-tested - 103 tests, 94%+ coverage, zero compromises
- π¨ Simple API - Single tool handles all operations elegantly
π¦ Installation
# Quick start - zero installation
npx @sylphx/pdf-reader-mcp
# Using pnpm (recommended)
pnpm add @sylphx/pdf-reader-mcp
# Using npm
npm install @sylphx/pdf-reader-mcp
# Using yarn
yarn add @sylphx/pdf-reader-mcp
# For Claude Desktop (easiest)
npx -y @smithery/cli install @sylphx/pdf-reader-mcp --client claude
π― Quick Start
Configuration
Add to your MCP client (claude_desktop_config.json, Cursor, Cline):
{
"mcpServers": {
"pdf-reader-mcp": {
"command": "npx",
"args": ["@sylphx/pdf-reader-mcp"]
}
}
}
Basic Usage
{
"sources": [{
"path": "documents/report.pdf"
}],
"include_full_text": true,
"include_metadata": true,
"include_page_count": true
}
Result:
- β Full text content extracted
- β PDF metadata (author, title, dates)
- β Total page count
- β Structural sharing - unchanged parts preserved
Extract Specific Pages
{
"sources": [{
"path": "documents/manual.pdf",
"pages": "1-5,10,15-20"
}],
"include_full_text": true
}
Absolute Paths (NEW in v1.3.0!)
// Windows - Both formats work!
{
"sources": [{
"path": "C:\\Users\\John\\Documents\\report.pdf"
}],
"include_full_text": true
}
// Unix/Mac
{
"sources": [{
"path": "/home/user/documents/contract.pdf"
}],
"include_full_text": true
}
No more "Absolute paths are not allowed" errors!
Extract Images with Natural Ordering
{
"sources": [{
"path": "presentation.pdf",
"pages": [1, 2, 3]
}],
"include_images": true,
"include_full_text": true
}
Response includes:
- Text and images in exact document order (Y-coordinate sorted)
- Base64-encoded images with metadata (width, height, format)
- Natural reading flow preserved for AI comprehension
Batch Processing
{
"sources": [
{ "path": "C:\\Reports\\Q1.pdf", "pages": "1-10" },
{ "path": "/home/user/Q2.pdf", "pages": "1-10" },
{ "url": "https://example.com/Q3.pdf" }
],
"include_full_text": true
}
β‘ All PDFs processed in parallel automatically!
β¨ Features
Core Capabilities
- β Text Extraction - Full document or specific pages with intelligent parsing
- β Image Extraction - Base64-encoded with complete metadata (width, height, format)
- β Content Ordering - Y-coordinate based layout preservation for natural reading flow
- β Metadata Extraction - Author, title, creation date, and custom properties
- β Page Counting - Fast enumeration without loading full content
- β Dual Sources - Local files (absolute or relative paths) and HTTP/HTTPS URLs
- β Batch Processing - Multiple PDFs processed concurrently
Advanced Features
- β‘ 5-10x Performance - Parallel page processing with Promise.all
- π― Smart Pagination - Extract ranges like "1-5,10-15,20"
- πΌοΈ Multi-Format Images - RGB, RGBA, Grayscale with automatic detection
- π‘οΈ Path Flexibility - Windows, Unix, and relative paths all supported (v1.3.0)
- π Error Resilience - Per-page error isolation with detailed messages
- π Large File Support - Efficient streaming and memory management
- π Type Safe - Full TypeScript with strict mode enabled
π What's New in v1.3.0
π Absolute Paths Now Supported!
// β
Windows
{ "path": "C:\\Users\\John\\Documents\\report.pdf" }
{ "path": "C:/Users/John/Documents/report.pdf" }
// β
Unix/Mac
{ "path": "/home/john/documents/report.pdf" }
{ "path": "/Users/john/Documents/report.pdf" }
// β
Relative (still works)
{ "path": "documents/report.pdf" }
Other Improvements:
- π Fixed Zod validation error handling
- π¦ Updated all dependencies to latest versions
- β 103 tests passing, 94%+ coverage maintained
v1.2.0 - Content Ordering
- Y-coordinate based text and image ordering
- Natural reading flow for AI models
- Intelligent line grouping
v1.1.0 - Image Extraction & Performance
- Base64-encoded image extraction
- 10x speedup with parallel processing
- Comprehensive test coverage (94%+)
π API Reference
read_pdf Tool
The single tool that handles all PDF operations.
Parameters
| Parameter | Type | Description | Default |
|---|---|---|---|
sources | Array | List of PDF sources to process | Required |
include_full_text | boolean | Extract full text content | false |
include_metadata | boolean | Extract PDF metadata | true |
include_page_count | boolean | Include total page count | true |
include_images | boolean | Extract embedded images | false |
Source Object
{
path?: string; // Local file path (absolute or relative)
url?: string; // HTTP/HTTPS URL to PDF
pages?: string | number[]; // Pages to extract: "1-5,10" or [1,2,3]
}
Examples
Metadata only (fast):
{
"sources": [{ "path": "large.pdf" }],
"include_metadata": true,
"include_page_count": true,
"include_full_text": false
}
From URL:
{
"sources": [{
"url": "https://arxiv.org/pdf/2301.00001.pdf"
}],
"include_full_text": true
}
Page ranges:
{
"sources": [{
"path": "manual.pdf",
"pages": "1-5,10-15,20" // Pages 1,2,3,4,5,10,11,12,13,14,15,20
}]
}
π§ Advanced Usage
Content is returned in natural reading order based on Y-coordinates:
Document Layout:
βββββββββββββββββββββββ
β [Title] Y:100 β
β [Image] Y:150 β
β [Text] Y:400 β
β [Photo A] Y:500 β
β [Photo B] Y:550 β
βββββββββββββββββββββββ
Response Order:
[
{ type: "text", text: "Title..." },
{ type: "image", data: "..." },
{ type: "text", text: "..." },
{ type: "image", data: "..." },
{ type: "image", data: "..." }
]
Benefits:
- AI understands spatial relationships
- Natural document comprehension
- Perfect for vision-enabled models
- Automatic multi-line text grouping
Enable extraction:
{
"sources": [{ "path": "manual.pdf" }],
"include_images": true
}
Response format:
{
"images": [{
"page": 1,
"index": 0,
"width": 1920,
"height": 1080,
"format": "rgb",
"data": "base64-encoded-png..."
}]
}
Supported formats: RGB, RGBA, Grayscale Auto-detected: JPEG, PNG, and other embedded formats
Absolute paths (v1.3.0+) - Direct file access:
{ "path": "C:\\Users\\John\\file.pdf" }
{ "path": "/home/user/file.pdf" }
Relative paths - Workspace files:
{ "path": "docs/report.pdf" }
{ "path": "./2024/Q1.pdf" }
Configure working directory:
{
"mcpServers": {
"pdf-reader-mcp": {
"command": "npx",
"args": ["@sylphx/pdf-reader-mcp"],
"cwd": "/path/to/documents"
}
}
}
Strategy 1: Page ranges
{ "sources": [{ "path": "big.pdf", "pages": "1-20" }] }
Strategy 2: Progressive loading
// Step 1: Get page count
{ "sources": [{ "path": "big.pdf" }], "include_full_text": false }
// Step 2: Extract sections
{ "sources": [{ "path": "big.pdf", "pages": "50-75" }] }
Strategy 3: Parallel batching
{
"sources": [
{ "path": "big.pdf", "pages": "1-50" },
{ "path": "big.pdf", "pages": "51-100" }
]
}
π§ Troubleshooting
"Absolute paths are not allowed"
Solution: Upgrade to v1.3.0+
npm update @sylphx/pdf-reader-mcp
Restart your MCP client completely.
"File not found"
Causes:
- File doesn't exist at path
- Wrong working directory
- Permission issues
Solutions:
Use absolute path:
{ "path": "C:\\Full\\Path\\file.pdf" }
Or configure cwd:
{
"pdf-reader-mcp": {
"command": "npx",
"args": ["@sylphx/pdf-reader-mcp"],
"cwd": "/path/to/docs"
}
}
"No tools showing up"
Solution:
npm cache clean --force
rm -rf node_modules package-lock.json
npm install @sylphx/pdf-reader-mcp@latest
Restart MCP client completely.
β‘ Performance
Benchmarks
| Operation | Ops/sec | Performance |
|---|---|---|
| Error handling | ~12,933 | β‘β‘β‘β‘β‘ |
| Extract full text | ~5,575 | β‘β‘β‘β‘ |
| Extract page | ~5,329 | β‘β‘β‘β‘ |
| Multiple pages | ~5,242 | β‘β‘β‘β‘ |
| Metadata only | ~4,912 | β‘β‘β‘ |
Parallel Processing
| Document | Speedup |
|---|---|
| 10-page PDF | 5-8x faster |
| 50-page PDF | 10x faster |
| 100+ pages | Linear scaling with CPU cores |
Benchmarks vary based on PDF complexity and system resources.
ποΈ Architecture
Tech Stack
| Component | Technology |
|---|---|
| Runtime | Node.js 22+ ESM |
| PDF Engine | PDF.js (Mozilla) |
| Validation | Zod + JSON Schema |
| Protocol | MCP SDK |
| Language | TypeScript (strict) |
| Testing | Vitest (103 tests) |
| Quality | Biome (50x faster) |
| CI/CD | GitHub Actions |
Design Principles
- π Security First - Flexible paths with secure defaults
- π― Simple Interface - One tool, all operations
- β‘ Performance - Parallel processing, efficient memory
- π‘οΈ Reliability - Per-page isolation, detailed errors
- π§ͺ Quality - 94%+ coverage, strict TypeScript
- π Type Safety - No
anytypes, strict mode - π Backward Compatible - Smooth upgrades always
π§ͺ Development
Prerequisites:
- Node.js >= 22.0.0
- pnpm (recommended) or npm
Setup:
git clone https://github.com/sylphxltd/pdf-reader-mcp.git
cd pdf-reader-mcp
pnpm install && pnpm build
Scripts:
pnpm run build # Build TypeScript
pnpm run test # Run 103 tests
pnpm run test:cov # Coverage (94%+)
pnpm run check # Lint + format
pnpm run check:fix # Auto-fix
pnpm run benchmark # Performance tests
Quality:
- β 103 tests
- β 94%+ coverage
- β 98%+ function coverage
- β Zero lint errors
- β Strict TypeScript
Quick Start:
- Fork repository
- Create branch:
git checkout -b feature/awesome - Make changes:
pnpm test - Format:
pnpm run check:fix - Commit: Use Conventional Commits
- Open PR
Commit Format:
feat(images): add WebP support
fix(paths): handle UNC paths
docs(readme): update examples
See CONTRIBUTING.md
π Documentation
- π Full Docs - Complete guides
- π Getting Started - Quick start
- π API Reference - Detailed API
- ποΈ Design - Architecture
- β‘ Performance - Benchmarks
- π Comparison - vs. alternatives
πΊοΈ Roadmap
β Completed
- Image extraction (v1.1.0)
- 5-10x parallel speedup (v1.1.0)
- Y-coordinate ordering (v1.2.0)
- Absolute paths (v1.3.0)
- 94%+ test coverage (v1.3.0)
π Coming Soon
- OCR for scanned PDFs
- Annotation extraction
- Form field extraction
- Table detection
- 100+ MB streaming
- Advanced caching
- PDF generation
Vote at Discussions
π€ Support
- π Bug Reports
- π¬ Discussions
- π Contributing
- π§ contact@sylphx.com
Show Your Support: β Star β’ π Watch β’ π Report bugs β’ π‘ Suggest features β’ π Contribute
π Stats
103 Tests β’ 94%+ Coverage β’ Production Ready
π Recognition
Featured on:
Trusted worldwide β’ Enterprise adoption β’ Battle-tested
π License
MIT License - Free for personal and commercial use.
See LICENSE for details.
Built with β€οΈ by Sylphx
Building the future of AI-powered document processing
Related Servers
Flight Planner
Create detailed flight plans using the fast-flights API.
Peek.com Remote MCP Server
Simplify trip planning with Peek.com's Remote MCP for amazing experiences
OSP Marketing Tools
A suite of tools for technical marketing content creation, optimization, and product positioning based on Open Strategy Partners' methodologies.
Asana
Interact with Asana tasks, projects, workspaces, and comments using the Asana API.
Logseq MCP Server
Interact with your Logseq knowledge base to create pages, manage blocks, and organize information programmatically.
Notion
Notion official MCP server
Goatcounter
Interact with the Goatcounter web analytics API.
NotesY
Access and manage Apple Notes on macOS via AppleScript.
Browser Use MCP Server
Automate browser actions using natural language commands. Powered by Playwright and supports multiple LLM providers.
Apple Reminders
Interact with Apple Reminders on macOS.