PDFtotext MCP Server
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., "@PDFtotext MCP Serverextract text from quarterly_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.
PDFtotext MCP Server
A reliable Model Context Protocol (MCP) server for PDF text extraction using the proven pdftotext utility from poppler-utils.
๐ Why This Server?
Unlike other PDF MCP servers that suffer from logging interference, complex dependencies, and reliability issues, pdftotext-mcp is:
โ Actually works - Clean JSON-RPC communication without stdout pollution
โ Reliable - Built on mature
pdftotextfrom poppler-utils (used by millions)โ Lightweight - Minimal dependencies, maximum compatibility
โ Production tested - Successfully tested with Claude Desktop and other MCP clients
โ Feature complete - Page-specific extraction, layout preservation, encoding options
โ Error handling - Comprehensive validation and helpful error messages
Related MCP server: MCP PDF Reader
๐ Features
๐ Extract text from entire PDF documents or specific pages
๐จ Preserve original layout formatting (optional)
๐ค Multiple text encoding support (UTF-8, Latin1, ASCII)
๐ Comprehensive metadata in responses (word count, file info, etc.)
๐ก๏ธ File validation and security checks
โก Fast processing with configurable timeouts
๐ Detailed error reporting with troubleshooting hints
๐ง Prerequisites
You must have pdftotext installed on your system:
Ubuntu/Debian
sudo apt update
sudo apt install poppler-utilsmacOS
brew install popplerWindows
# Using Chocolatey
choco install poppler
# Using Scoop
scoop install popplerVerify Installation
pdftotext -v๐ฆ Installation
Option 1: Global Installation (Recommended)
npm install -g pdftotext-mcpOption 2: Use with npx (No Installation)
npx pdftotext-mcpOption 3: Local Development
git clone https://github.com/jpwebb/pdftotext-mcp.git
cd pdftotext-mcp
npm install
npm startโ๏ธ Configuration
Add to your MCP client configuration:
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"pdftotext": {
"command": "pdftotext-mcp"
}
}
}Or with npx:
{
"mcpServers": {
"pdftotext": {
"command": "npx",
"args": ["pdftotext-mcp"]
}
}
}Other MCP Clients
The server works with any MCP-compatible client. Use pdftotext-mcp as the command.
๐ฏ Usage
The server provides a single, powerful tool: read_pdf_text
Basic Usage
Extract entire document
{
"tool": "read_pdf_text",
"arguments": {
"path": "./document.pdf"
}
}Extract specific page
{
"tool": "read_pdf_text",
"arguments": {
"path": "./document.pdf",
"page": 2
}
}Preserve layout formatting
{
"tool": "read_pdf_text",
"arguments": {
"path": "./document.pdf",
"layout": true
}
}Custom encoding
{
"tool": "read_pdf_text",
"arguments": {
"path": "./document.pdf",
"encoding": "Latin1"
}
}Response Format
Success Response
{
"success": true,
"file": "document.pdf",
"path": "/absolute/path/to/document.pdf",
"extractedText": "Full text content...",
"pageSpecific": "all",
"layoutPreserved": false,
"encoding": "UTF-8",
"fileSize": 1048576,
"lastModified": "2024-01-15T10:30:00.000Z",
"extractedAt": "2024-01-15T10:35:00.000Z",
"textLength": 5234,
"wordCount": 892
}Error Response
{
"success": false,
"error": "File not found: ./nonexistent.pdf",
"errorType": "FILE_NOT_FOUND",
"file": "./nonexistent.pdf",
"timestamp": "2024-01-15T10:35:00.000Z"
}๐ API Reference
Tool: read_pdf_text
Extracts text content from PDF files using pdftotext.
Parameters
Parameter | Type | Required | Default | Description |
| string | โ | - | Path to PDF file (relative or absolute) |
| number | โ | all pages | Specific page to extract (1-based) |
| boolean | โ |
| Preserve original text layout |
| string | โ |
| Output text encoding |
Supported Encodings
UTF-8(default)Latin1ASCII
Error Types
FILE_NOT_FOUND- PDF file doesn't existPERMISSION_DENIED- Cannot read the fileINVALID_PDF- File is not a valid PDFPDFTOTEXT_ERROR- pdftotext utility errorUNKNOWN_ERROR- Unexpected error
๐ง Troubleshooting
"pdftotext is not available"
Solution: Install poppler-utils (see Prerequisites)
"File not found"
Solutions:
Use absolute paths:
/home/user/document.pdfCheck file exists:
ls -la /path/to/file.pdfVerify MCP server working directory
"Permission denied"
Solutions:
Check file permissions:
chmod 644 document.pdfEnsure directory is readable:
chmod 755 /path/to/directory/
"File is not a valid PDF"
Solutions:
Verify file is actually a PDF:
file document.pdfCheck for file corruption
Try with a different PDF file
MCP Connection Issues
Solutions:
Restart your MCP client completely
Check configuration syntax in config file
Verify
pdftotext-mcpis accessible in PATHCheck MCP client logs for detailed errors
๐งช Testing
# Run tests
npm test
# Run tests with watch mode
npm run test:watch
# Run linter
npm run lint๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Development Setup
git clone https://github.com/jpwebb/pdftotext-mcp.git
cd pdftotext-mcp
npm installRunning Locally
npm startCode Style
This project uses ESLint. Run npm run lint to check code style.
๐ License
MIT - see LICENSE file for details.
๐ Acknowledgments
Built for the Model Context Protocol ecosystem
Uses poppler-utils
pdftotextutilityInspired by the need for reliable PDF processing in MCP environments
๐ Related
Made for the MCP community
Available Tools
1 toolread_pdf_textB
Extract text content from a PDF file using pdftotext from poppler-utils
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to the PDF file (relative to current working directory or absolute path) | |
| page | No | Specific page number to extract (1-based indexing). If not specified, extracts all pages. | |
| layout | No | Preserve original text layout formatting (default: false) | |
| encoding | No | Text encoding for output (default: UTF-8) | UTF-8 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the implementation method but lacks details on error handling (e.g., invalid paths, corrupted files), performance characteristics, or output format beyond text extraction. This leaves significant gaps for an agent to understand how the tool behaves in practice.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded with the core functionality and includes implementation details that add value without verbosity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity (a file processing tool with 4 parameters), no annotations, and no output schema, the description is minimally adequate. It covers the basic purpose but lacks details on output (e.g., text format, error messages) and behavioral context, leaving the agent with incomplete information for reliable use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100%, so the input schema fully documents all parameters (path, page, layout, encoding) with descriptions, defaults, and constraints. The description adds no additional parameter semantics beyond what's in the schema, meeting the baseline for high coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Extract text content') and resource ('from a PDF file'), and specifies the implementation method ('using pdftotext from poppler-utils'). It's specific and unambiguous, though it doesn't need to differentiate from siblings since none exist.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives (e.g., other PDF processing tools or methods). The description only states what it does, not when it's appropriate or any prerequisites like file accessibility or format constraints.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
With only one tool, there is no possibility of ambiguity or overlap between tools. The tool's purpose is clearly defined and distinct by default.
The single tool name follows a clear verb_noun pattern (read_pdf_text), and with only one tool, consistency is inherently perfect as there are no other names to compare against.
A single tool is too few for most practical server purposes, as it severely limits functionality and flexibility. While it might suffice for a minimal use case, it feels thin and incomplete for broader PDF processing needs.
The server's domain appears to be PDF text extraction, but with only one tool, there are significant gaps. For example, there are no tools for handling metadata, images, tables, or other PDF features, making the surface severely incomplete for typical PDF processing tasks.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Hosted MCP server: convert PDFs to clean, LLM-ready Markdown with tables, formulas and OCR.
Document-to-Markdown MCP server โ convert PDF, Office and HTML into LLM-ready Markdown.
High-fidelity PDF to structured Markdown conversion and document field extraction.
Generate and read PDFs for AI agents: a generate_pdf and a read_pdf tool, priced per document.
Related MCP Servers
- FlicenseAqualityNot gradedmaintenanceA Model Context Protocol server that extracts and processes content from PDF documents, providing text extraction, metadata retrieval, page-level processing, and PDF validation capabilities.41
- FlicenseDqualityDmaintenanceIntelligent PDF processing server that automatically detects PDF types (text or scanned), extracts text, performs OCR recognition in 10 languages, searches content with regex support, and retrieves metadata through the Model Context Protocol.73
- AlicenseAqualityCmaintenanceA Model Context Protocol server that enables the extraction of text, metadata, and embedded images from PDF files. It provides tools for searching text with context, reading specific pages, and counting total pages within a document.7291MIT
- AlicenseNot gradedqualityDmaintenanceA high-performance Model Context Protocol server that enables AI agents to extract text, images, and metadata from PDF documents using parallel processing. It features intelligent Y-coordinate content ordering to preserve natural reading flow and supports both local files and URL-based sources.14MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jpwebb/pdftotext-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server