PDF 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 MCP Server extract the text and charts from https://example.com/q3-report.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 Server
An MCP (Model Context Protocol) server that fetches PDFs from URLs and intelligently parses them for optimal AI consumption. Supports text extraction, image rendering, and hybrid modes.
Features
Multiple Processing Modes:
π€ Text Mode: Fast text extraction for text-heavy documents
πΌοΈ Images Mode: Renders all pages as high-quality images
π Hybrid Mode: Extracts text + renders visual pages (charts, diagrams)
π€ Auto Mode: Intelligently detects the best approach based on content
Smart Document Analysis: Automatically identifies pages with visual content
Configurable Quality: Adjustable DPI (72-300) for image rendering
Metadata Extraction: Extracts PDF title, author, page count, and more
Security: URL validation, file size limits, and timeout protection
Related MCP server: PDF Reader MCP Server
Installation
# Install dependencies
npm install
# Build the project
npm run buildDevelopment
# Run in development mode
npm run dev
# Watch mode (auto-rebuild on changes)
npm run watchUsage
As an MCP Server
Add to your MCP client configuration (e.g., Claude Desktop):
{
"mcpServers": {
"pdf-parser": {
"command": "node",
"args": ["C:\\dev\\aii-mcp-example\\dist\\index.js"]
}
}
}Or in development mode:
{
"mcpServers": {
"pdf-parser": {
"command": "npm",
"args": ["run", "dev"],
"cwd": "C:\\dev\\aii-mcp-example"
}
}
}Tool: fetch_and_parse_pdf
Fetches a PDF from a URL and parses it according to the specified mode.
Parameters:
url(required): URL of the PDF to fetchmode(optional): Processing mode -"text","images","hybrid", or"auto"(default:"auto")dpi(optional): Image rendering quality, 72-300 (default:150)maxPages(optional): Maximum pages to render as images, 1-100 (default:50)pages(optional): Array of specific page numbers to render
Examples:
// Auto mode - intelligently detects best approach
{
"url": "https://example.com/document.pdf"
}
// Text-only extraction
{
"url": "https://example.com/report.pdf",
"mode": "text"
}
// Render all pages as images
{
"url": "https://example.com/slides.pdf",
"mode": "images",
"dpi": 200,
"maxPages": 20
}
// Hybrid mode with specific pages
{
"url": "https://example.com/report.pdf",
"mode": "hybrid",
"pages": [1, 5, 10]
}How It Works
Mode Selection Logic
Auto Mode analyzes the document and selects:
Text Mode: For documents with high text density and no visual elements
Images Mode: For documents with >50% visual pages or very low text density
Hybrid Mode: For mixed-content documents (text + charts/diagrams)
Hybrid Mode Intelligence
In hybrid mode, the tool:
Extracts all text content
Analyzes each page to detect visual elements (images, charts, low text density)
Selectively renders only pages with important visual content
Returns both text and images for optimal AI understanding
Performance Considerations
Text extraction: <1s for most PDFs
Image rendering: ~500ms per page
Memory usage: ~200MB for typical documents
Maximum file size: 50MB (configurable)
Request timeout: 30 seconds
Architecture
src/
βββ index.ts # MCP server entry point
βββ tools/
β βββ pdfTool.ts # PDF tool implementation
βββ utils/
β βββ fetcher.ts # URL fetching with validation
β βββ pdfParser.ts # Text extraction (PDF.js)
β βββ pdfRenderer.ts # Image rendering (Canvas)
β βββ documentAnalyzer.ts # Intelligent content detection
βββ types/
βββ index.ts # TypeScript type definitionsTechnologies
@modelcontextprotocol/sdk: MCP server framework
PDF.js: PDF parsing and text extraction
@napi-rs/canvas: High-performance server-side canvas for rendering
Zod: Runtime type validation
TypeScript: Type-safe development
Security Features
β URL protocol validation (HTTP/HTTPS only)
β File size limits (default 50MB)
β Request timeouts (30 seconds)
β Content-Type verification
β Input validation with Zod schemas
Error Handling
The server provides detailed error messages for:
Invalid URLs
Network failures
Timeout errors
PDF parsing errors
File size violations
Unsupported content types
Limitations
Maximum file size: 50MB
Maximum pages for rendering: 100
Supported protocols: HTTP, HTTPS only
Image format: PNG (base64 encoded)
Use Cases
π Research Papers: Hybrid mode extracts text + renders figures
π Financial Reports: Hybrid mode for text + charts
π Text Documents: Text mode for fast, efficient extraction
π¨ Presentations: Images mode for slide decks
π Forms: Images mode to preserve layout
π eBooks: Text mode for optimal reading
License
MIT
Available Tools
2 toolsfetch_and_parse_pdfA
Fetches a PDF from a URL and parses it. Supports multiple modes: text extraction, image rendering, hybrid (text + images), or auto-detection. Use text mode for text-heavy documents, images mode for visual content, hybrid for mixed content, or auto to let the tool decide based on document analysis.
Inputs: url (required), dpi, mode, pages, +1 more.
upload_pdf_to_geminiA
Fetches a PDF from a URL, renders it as images, and uploads to Google Gemini for advanced visual processing and analysis with a custom prompt. Gemini can analyze charts, diagrams, tables, handwriting, and complex visual layouts that traditional text extraction might miss. Requires GOOGLE_API_KEY or GEMINI_API_KEY environment variable. Best for visually complex documents, forms, presentations, or documents with mixed content.
Inputs: url (required), prompt (required), dpi, model, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 2 tools
Both tools start by fetching a PDF from a URL, and the first tool's hybrid/auto image-rendering modes overlap conceptually with the second tool's visual analysis, so an agent could easily pick the wrong one for mixed-content documents. The descriptions do clarify the split (local parsing vs. Gemini-powered analysis), which keeps the boundary usable but not crisp.
Both names are snake_case, verb-first, and include the 'pdf' resource noun, so the pattern is largely predictable. The structure differs slightly (verb_and_verb_noun vs. verb_noun_to_service), a minor deviation.
Two tools is thin for a PDF server, but each covers a genuinely different processing strategy (local parsing vs. Gemini upload) rather than being redundant. It sits at the borderline where the surface feels minimal.
The tools only accept PDFs via URLβno local file path supportβand there is no page-range selection, no output-saving/return-format control, and no way to chain or combine results. For a PDF-processing domain these are significant gaps that will block common agent workflows.
Maintenance
Related MCP Connectors
Convert PDF URLs to clean text or LLM-ready Markdown, with RAG chunks and OCR in 100+ languages.
Fetch any URL as clean markdown, HTML, or a screenshot for AI agents.
PDF URLs to per-page text, tables as rows, Markdown, metadata and OCR for scanned pages.
Convert PDF URLs to clean Markdown and text for RAG and LLM input. Pay per PDF on Apify.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables reading and extracting content from PDF documents including text (as Markdown), images, tables, and metadata from both local files and URLs, with OCR support for scanned documents.2-
- AlicenseAqualityDmaintenanceEnables AI agents to securely read and extract information from PDF files including text content, metadata, and page counts from both local files and URLs within the project context.1MIT
- AlicenseNot gradedqualityDmaintenanceFetches web pages and converts them to markdown for LLM consumption, supporting chunked reading and raw content extraction.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to reliably fetch public web URLs and extract clean, agent-ready text, Markdown, links, and metadata, with automatic browser fallback and optional x402 payment support.MIT