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 Server search for 'conclusion' in research_paper.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 Reader MCP Server
A Model Context Protocol (MCP) server that provides efficient PDF text extraction capabilities for Claude Code. This server allows you to read, search, and extract metadata from PDF files without loading the entire content into Claude's context window.
npm package: @fabriqa.ai/pdf-reader-mcp Author: Cengiz Han Blog Post: How I Built This Tool to Save My Context
Features
Read PDF Files: Extract full text content from PDF files with optional text cleaning
Search PDFs: Search for specific text within PDFs with context-aware results
Extract Metadata: Get detailed metadata including title, author, page count, dates, etc.
Efficient Context Usage: Process large PDFs without consuming excessive Claude Code context
Flexible Options: Support for page ranges, case-sensitive search, and more
Related MCP server: PDF MCP Server
Installation
Option A: Install from npm (Recommended)
npm install -g @fabriqa.ai/pdf-reader-mcpAfter installation, the server will be available globally. You can configure it by running:
# The package will be installed in your global node_modules
# Typically: /usr/local/lib/node_modules/@fabriqa.ai/pdf-reader-mcpOption B: Install from source
Clone this repository:
git clone https://github.com/hancengiz/read_pdf_as_text_mcp.git
cd read_pdf_as_text_mcpInstall dependencies:
npm installConfiguration
If installed via npm (Recommended):
Option 1: Using Claude Code CLI (Easiest)
# Add the MCP server
claude mcp add pdf-reader npx @fabriqa.ai/pdf-reader-mcp@latest
# Or use the convenience script
npx @fabriqa.ai/pdf-reader-mcp/update-config.jsOption 2: Manual Configuration
Add to your ~/.claude.json:
{
"mcpServers": {
"pdf-reader": {
"command": "npx",
"args": [
"@fabriqa.ai/pdf-reader-mcp@latest"
]
}
}
}This uses npx to automatically run the globally installed package without needing to specify paths.
Quick Setup Script (Optional):
After installing via npm, you can use the included configuration script to automatically update your ~/.claude.json:
npx @fabriqa.ai/pdf-reader-mcp/update-config.jsOr if installed from source:
node update-config.jsThis will automatically add the MCP server using npx, making it available machine-wide across all your projects.
Manual Configuration:
For Claude Desktop, edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"pdf-reader": {
"command": "npx",
"args": [
"@fabriqa.ai/pdf-reader-mcp@latest"
]
}
}
}Usage
Once configured, restart Claude Code. The following tools will be available:
1. read-pdf
Extract text content from a PDF file.
Parameters:
file(required): Path to the PDF filepages(optional): Page range (e.g., '1-5', '1,3,5', 'all'). Default: 'all'clean_text(optional): Clean and normalize extracted text. Default: falseinclude_metadata(optional): Include PDF metadata in output. Default: true
Example:
Can you read the PDF at /path/to/document.pdf?2. search-pdf
Search for specific text within a PDF file.
Parameters:
file(required): Path to the PDF filequery(required): Text to search forcase_sensitive(optional): Case sensitive search. Default: falsewhole_word(optional): Match whole words only. Default: false
Example:
Search for "machine learning" in /path/to/document.pdf3. pdf-metadata
Extract metadata from a PDF file.
Parameters:
file(required): Path to the PDF file
Example:
Get metadata from /path/to/document.pdfExample Workflow
Here's how you might use this MCP server with Claude Code:
Extract metadata first to understand the document:
What's the metadata for ~/Documents/research-paper.pdf?Search for specific topics without reading the entire file:
Search for "neural networks" in ~/Documents/research-paper.pdfRead specific sections when you know what you're looking for:
Read pages 10-15 from ~/Documents/research-paper.pdf with cleaned text
Benefits
Context Efficiency: Process large PDF files without loading everything into Claude's context
Faster Analysis: Search and extract only what you need
Better Performance: Reduce token usage when working with multiple or large PDFs
Flexible Extraction: Choose what information to extract and how to format it
Technical Details
Built with the @modelcontextprotocol/sdk
Uses pdf-parse for PDF text extraction
Runs as a local Node.js process communicating via stdio
Supports all PDF versions that pdf-parse can handle
Troubleshooting
Server not appearing in Claude Code
Verify the path in your configuration file is correct
Ensure Node.js is installed and in your PATH
Check that dependencies are installed:
npm installRestart Claude Code completely
Check Claude Code logs for any error messages
PDF not found errors
Use absolute paths to PDF files
Verify file permissions
Ensure the PDF file exists at the specified location
Text extraction issues
Some PDFs (scanned images) may not contain extractable text
Try enabling
clean_textoption for better formattingComplex layouts may affect text extraction quality
Development
To modify or extend the server:
Edit
index.jsto add new tools or modify existing onesUpdate the
ListToolsRequestSchemahandler to register new toolsAdd corresponding handlers in the
CallToolRequestSchemahandlerRestart the server (restart Claude Code) to test changes
License
MIT
Author
Created by Cengiz Han
Contributing
Feel free to submit issues or pull requests to improve this MCP server.
Available Tools
3 toolspdf-metadataB
Extract metadata from a PDF file including title, author, page count, creation date, etc.
Inputs: file (required).
read-pdfA
Extract text from a PDF file. Returns the full text content of the PDF with optional page filtering and text cleaning.
Inputs: file (required), pages, clean_text, include_metadata.
search-pdfA
Search for specific text within a PDF file. Returns matching text with context and page numbers.
Inputs: file (required), query (required), case_sensitive, whole_word.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: pdf-metadata extracts document properties, read-pdf extracts all text content, and search-pdf finds specific text within the document. There is no overlap in functionality, making tool selection straightforward for an agent.
All tools follow a consistent verb-noun pattern using hyphens (pdf-metadata, read-pdf, search-pdf). The naming is predictable and readable, with 'pdf' consistently placed as a suffix or prefix across all tools.
Three tools is a minimal but reasonable count for a PDF reader server, covering core operations: metadata extraction, full text reading, and text search. It could benefit from additional tools like PDF conversion or annotation handling, but it's well-scoped for basic use.
The toolset covers essential PDF reading operations: metadata, full text extraction, and search. Minor gaps exist, such as no tools for PDF manipulation (e.g., merging, splitting) or advanced features like OCR, but agents can perform basic workflows without dead ends.
Related MCP Connectors
Parse, extract, split, and ask over digital PDFs (text layer, no OCR) from Cursor and Claude.
Extract text, pages and metadata from PDFs in bulk, with OCR for scanned files.
PDF tools for AI agents: validate, extract, merge, split, compress, OCR, sign and redact.
Generate and read PDFs for AI agents: a generate_pdf and a read_pdf tool, priced per document.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to search and query PDF documents through a local RAG system with vector embeddings. Provides semantic document search capabilities while keeping all data stored locally without external dependencies.-
- FlicenseNot gradedqualityDmaintenanceEnables processing and analysis of large PDF files through text extraction, search functionality, and intelligent chunking strategies. Provides comprehensive PDF operations including metadata retrieval, page-range text extraction, and content search with contextual results.-
- AlicenseNot gradedqualityDmaintenanceEnables intelligent search and question-answering over PDF documents using semantic similarity and keyword search. Supports OCR for scanned PDFs, persistent vector storage with ChromaDB, and maintains source tracking with page numbers.6MIT
- 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.1664 npmMIT