PDF Inspector MCP Server
Inspects local PDF files, extracting text, counting pages, and performing OCR on scanned PDFs using standard libraries.
README
PDF Inspector MCP Server
A lightweight, zero-configuration TypeScript MCP server that inspects local PDF files using standard, widely-adopted libraries.
Features
extract_text— Extracts raw embedded text from PDFs usingpdf-parse.count_pages— Returns the total number of pages in a PDF.ocr_pdf— Renders PDF pages to images and performs OCR withtesseract.jsfor image-based (scanned) PDFs.
Dependencies
| Package | Purpose |
|---|---|
@modelcontextprotocol/sdk |
Official MCP TypeScript SDK |
pdf-parse |
Zero-config text extraction and page counting |
pdfjs-dist |
PDF rendering engine (standard Mozilla library) |
canvas |
Canvas implementation for Node.js rendering |
tesseract.js |
Pure-JavaScript OCR (lightweight, no binary installs) |
zod |
Schema validation for tool parameters |
All dependencies install with a standard npm install and require no external binary setup beyond what npm provides.
Quick Start
npm install
npm run build
npm start
Or run directly with tsx during development:
npm run dev
Running with an MCP Client
The server communicates over stdio, the standard MCP transport. Use it with Claude Code, VS Code, Cursor, or any host that launches node dist/index.js.
Example claude_desktop_config.json snippet:
{
"mcpServers": {
"pdf-inspector": {
"command": "node",
"args": ["/absolute/path/to/pdf-inspector-mcp/dist/index.js"]
}
}
}
Tools
extract_text
| Parameter | Type | Default | Description |
|---|---|---|---|
filePath |
string |
— | Path to PDF |
maxLength |
number |
10000 |
Max characters to return |
count_pages
| Parameter | Type | Default | Description |
|---|---|---|---|
filePath |
string |
— | Path to PDF |
ocr_pdf
| Parameter | Type | Default | Description |
|---|---|---|---|
filePath |
string |
— | Path to PDF |
pages |
number[] |
[] |
1-based page numbers (empty = all) |
language |
string |
"eng" |
Tesseract language code |
scale |
number |
2.0 |
Render scale (higher = sharper, slower) |
Note:
ocr_pdfusespdfjs-distto render each page to an image, then passes the PNG totesseract.js. For multi-page PDFs this can take several seconds per page.
Zero-Config Design
- No
.envfiles or external services required. pdf-parsehandles text extraction with no setup.tesseract.jsbundles WASM and language data automatically.pdfjs-distuses the bundledpdf.worker.mjsfile.canvasrelies on standardnpmprebuilds.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.