The PDF Reader MCP Server allows AI agents to securely read and extract data from PDF files.
Capabilities:
Extract full text content from PDFs
Extract text from specific pages or page ranges
Retrieve PDF metadata (author, title, creation date, etc.)
Get the total page count of a PDF
Process multiple PDF sources (local paths or URLs) in a single request
Operate securely within the defined project root directory
Provide structured JSON output for easy parsing by AI agents
Be installed and run via npm (npx) or Docker
Integrates with Codecov for code coverage reporting, as indicated by the badge showing coverage statistics for the project.
Provides Docker container deployment option, allowing users to run the PDF reader MCP server in an isolated environment with project directory mounting.
Integrates with GitHub for CI/CD pipeline execution, issue tracking, and repository management for the PDF reader MCP server.
Publishes to npm registry allowing installation via npm, with version tracking displayed through npm badge.
Future plans include PWA support for the documentation site, enabling offline access and mobile optimization.
Uses Vitest for performance benchmarking, measuring operations per second for various PDF processing scenarios.
Leverages Zod for input validation, ensuring that requests to the PDF reader MCP server are properly formatted and validated.
Click on "Install 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 Serverextract text from the quarterly report PDF in the reports folder"
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.
π @sylphx/pdf-reader-mcp
Production-ready PDF processing server for AI agents
5-10x faster parallel processing β’ Y-coordinate content ordering β’ 94%+ test coverage β’ 103 tests passing
π 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.
The Problem:
The Solution:
Result: Production-ready PDF processing that scales.
Related MCP server: File Converter MCP Server
β‘ Key Features
Performance
π 5-10x faster than sequential with automatic parallelization
β‘ 12,933 ops/sec error handling, 5,575 ops/sec text extraction
π¨ Process 50-page PDFs in seconds with multi-core utilization
π¦ Lightweight with minimal dependencies
Developer Experience
π― Path Flexibility - Absolute & relative paths, Windows/Unix support (v1.3.0)
πΌοΈ Smart Ordering - Y-coordinate based content preserves document layout
π‘οΈ Type Safe - Full TypeScript with strict mode enabled
π Battle-tested - 103 tests, 94%+ coverage, 98%+ function coverage
π¨ Simple API - Single tool handles all operations elegantly
π Performance Benchmarks
Real-world performance from production testing:
Operation | Ops/sec | Performance | Use Case |
Error handling | 12,933 | β‘β‘β‘β‘β‘ | Validation & safety |
Extract full text | 5,575 | β‘β‘β‘β‘ | Document analysis |
Extract page | 5,329 | β‘β‘β‘β‘ | Single page ops |
Multiple pages | 5,242 | β‘β‘β‘β‘ | Batch processing |
Metadata only | 4,912 | β‘β‘β‘ | Quick inspection |
Parallel Processing Speedup
Document | Sequential | Parallel | Speedup |
10-page PDF | ~2s | ~0.3s | 5-8x faster |
50-page PDF | ~10s | ~1s | 10x faster |
100+ pages | ~20s | ~2s | Linear scaling with CPU cores |
Benchmarks vary based on PDF complexity and system resources.
π¦ Installation
Claude Code
Claude Desktop
Add to claude_desktop_config.json:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
VS Code
Cursor
Open Settings β MCP β Add new MCP Server
Select Command type
Enter:
npx @sylphx/pdf-reader-mcp
Windsurf
Add to your Windsurf MCP config:
Cline
Add to Cline's MCP settings:
Warp
Go to Settings β AI β Manage MCP Servers β Add
Command:
npx, Args:@sylphx/pdf-reader-mcp
Smithery (One-click)
Manual Installation
π― Quick Start
Basic Usage
Result:
β Full text content extracted
β PDF metadata (author, title, dates)
β Total page count
β Structural sharing - unchanged parts preserved
Extract Specific Pages
Absolute Paths (v1.3.0+)
No more "Absolute paths are not allowed" errors!
Extract Images with Natural Ordering
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
β‘ 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!
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 |
| Array | List of PDF sources to process | Required |
| boolean | Extract full text content |
|
| boolean | Extract PDF metadata |
|
| boolean | Include total page count |
|
| boolean | Extract embedded images |
|
Source Object
Examples
Metadata only (fast):
From URL:
Page ranges:
π§ Advanced Usage
Content is returned in natural reading order based on Y-coordinates:
Benefits:
AI understands spatial relationships
Natural document comprehension
Perfect for vision-enabled models
Automatic multi-line text grouping
Enable extraction:
Response format:
Supported formats: RGB, RGBA, Grayscale Auto-detected: JPEG, PNG, and other embedded formats
Absolute paths (v1.3.0+) - Direct file access:
Relative paths - Workspace files:
Configure working directory:
Strategy 1: Page ranges
Strategy 2: Progressive loading
Strategy 3: Parallel batching
π§ Troubleshooting
"Absolute paths are not allowed"
Solution: Upgrade to v1.3.0+
Restart your MCP client completely.
"File not found"
Causes:
File doesn't exist at path
Wrong working directory
Permission issues
Solutions:
Use absolute path:
Or configure cwd:
"No tools showing up"
Solution:
Restart MCP client completely.
ποΈ 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:
Scripts:
Quality:
β 103 tests
β 94%+ coverage
β 98%+ function coverage
β Zero lint errors
β Strict TypeScript
Quick Start:
Fork repository
Create branch:
git checkout -b feature/awesomeMake changes:
pnpm testFormat:
pnpm run check:fixCommit: Use Conventional Commits
Open PR
Commit Format:
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)
π Next
OCR for scanned PDFs
Annotation extraction
Form field extraction
Table detection
100+ MB streaming
Advanced caching
PDF generation
Vote at Discussions
π Recognition
Featured on:
Trusted worldwide β’ Enterprise adoption β’ Battle-tested
π€ Support
π Bug Reports
π¬ Discussions
π Documentation
π§ Email
Show Your Support: β Star β’ π Watch β’ π Report bugs β’ π‘ Suggest features β’ π Contribute
π Stats
103 Tests β’ 94%+ Coverage β’ Production Ready
π License
MIT Β© Sylphx
π Credits
Built with:
Special thanks to the open source community β€οΈ
Powered by Sylphx
This project uses the following @sylphx packages:
@sylphx/mcp-server-sdk - MCP server framework
@sylphx/biome-config - Biome configuration
@sylphx/tsconfig - TypeScript configuration
@sylphx/bump - Version management
@sylphx/doctor - Project health checker
@sylphx/leaf - Documentation framework
@sylphx/leaf-theme-default - Documentation theme