pdf-mcp
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 search my PDFs for anything about the Q3 budget"
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
An MCP server that gives LLMs searchable access to your PDF filing cabinet.
Point it at a folder of PDFs and it indexes every document — extracting text page by page, building a full-text search index, and embedding content for semantic similarity search. Works with Claude.ai, Claude Code, and any MCP-compatible client.
Features
Hybrid search — FTS5 keyword matching + semantic vector search (e5-large via sqlite-vec), cross-encoder reranking (bge-reranker-v2-m3), and LLM relevance filtering
Handles scanned PDFs — pymupdf extracts text from OCR'd documents
Incremental indexing — SHA256 hash tracking means restarts only process new or changed files
Single-file database — everything stored in one portable SQLite file (FTS5 + vectors)
Zero external services — runs fully local; Together API optional for faster bulk embedding
Related MCP server: pdf2mcp
Quick start
# Install
git clone https://github.com/jkp/pdf-mcp.git
cd pdf-mcp
uv sync
# Point at your PDFs
export PDF_MCP_VAULT_PATH=~/Documents/PDFs
# Run (stdio mode — for Claude Code, Cursor, etc.)
uv run pdf-mcpConfiguration
All settings use the PDF_MCP_ prefix and can be set via environment variables or a .env file.
Variable | Default | Description |
|
| Directory containing your PDFs |
|
| SQLite database location |
|
|
|
|
| HTTP server port |
|
| MCP endpoint path (set to |
| Optional — enables faster bulk embedding and LLM relevance scoring | |
|
| Logging level |
OAuth (for HTTP transport)
Variable | Description |
| GitHub OAuth app client ID |
| GitHub OAuth app client secret |
| Public URL of the server |
| Comma-separated GitHub usernames |
| Directory for OAuth state persistence |
MCP tools
Tool | Description |
| Hybrid full-text + semantic search with reranking and relevance filtering |
| List/filter PDFs by filename pattern |
| Extract text from a PDF (all pages or specific range) |
| PDF metadata — page count, author, title, file size |
| Rename a PDF with automatic reindex |
| Manually trigger reindexing of all PDFs |
Search pipeline
query
│
├─► Vector search (e5-large embeddings, sqlite-vec KNN)
├─► FTS5 keyword search (porter stemming)
│
└─► Union + deduplicate
│
├─► Cross-encoder reranker (bge-reranker-v2-m3)
└─► LLM relevance filter (scores 1-5, drops noise)
│
└─► ResultsDeployment
Docker / Podman
docker build -t pdf-mcp .
docker run -v ~/Documents/PDFs:/data/vault -v pdf-mcp-data:/data \
-e PDF_MCP_VAULT_PATH=/data/vault \
-e PDF_MCP_DB_PATH=/data/pdf.db \
-e PDF_MCP_TRANSPORT=http \
-p 10201:10201 \
pdf-mcpClaude Code (stdio)
Add to your MCP config:
{
"mcpServers": {
"pdf": {
"command": "uv",
"args": ["--directory", "/path/to/pdf-mcp", "run", "pdf-mcp"],
"env": {
"PDF_MCP_VAULT_PATH": "~/Documents/PDFs"
}
}
}
}Claude.ai (remote HTTP)
Add as a remote MCP server using the HTTP URL (e.g., https://your-server/mcp). OAuth will handle authentication.
Performance
First startup indexes and embeds all PDFs:
Text extraction: ~2s per PDF (~30 min for 800 PDFs)
Embedding: ~50 PDFs/min local, ~500 PDFs/min via Together API
Search: <1s per query (vector + FTS5 + reranking)
Subsequent startups are instant — hash-based skip.
Development
uv sync
uv run pytest -vLicense
MIT
Available Tools
6 toolsget_pdf_infoGet PDF InfoBRead-only
Get metadata about a PDF without extracting full text.
Args: filename: PDF filename
Inputs: filename (required). Returns: object
list_pdfsList PDFsBRead-only
List PDFs in the filing cabinet, optionally filtered by filename pattern.
Args: pattern: Optional filename substring to filter by (e.g., "mortgage", "2024") limit: Maximum number of results
Inputs: limit, pattern. Returns: result
read_pdfRead PDFARead-only
Extract text from a PDF, optionally specific pages.
Args: filename: PDF filename (e.g., "2024-01-15 Invoice.pdf") pages: Optional page range (e.g., "1-3", "5", "1,3,5"). Omit for all pages.
Inputs: filename (required), pages. Returns: object
reindex_pdfsReindex PDFsARead-only
Reindex all PDFs in the filing cabinet.
Use this after adding new PDFs or if search results seem stale.
Inputs: no named parameters. Returns: object
rename_pdfRename PDFC
Rename a PDF file in the filing cabinet.
Args: old_filename: Current filename new_filename: New filename
Inputs: new_filename (required), old_filename (required). Returns: object
search_pdfsSearch PDFsARead-only
Search across all indexed PDFs using full-text and semantic search.
Combines FTS5 keyword matching with vector similarity search, reranks with a cross-encoder, and filters by LLM relevance scoring.
Args: query: Search query (natural language or keywords) limit: Maximum number of results
Inputs: query (required), limit. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct action on a distinct aspect of the PDF domain: rename, reindex, read (text extraction), info (metadata), search, and list. The closest pair, read_pdf vs get_pdf_info, is clearly separated by their descriptions (full text vs metadata without extraction), and list_pdfs vs search_pdfs differ by enumeration vs query.
All six tools follow a consistent verb_noun snake_case pattern (rename_pdf, reindex_pdfs, read_pdf, get_pdf_info, search_pdfs, list_pdfs) with no style mixing or vague names.
Six tools is well within the ideal 3-15 range and each earns its place across file management, retrieval, and maintenance. No redundant or trivial tools are present.
The surface covers reading, metadata, search, listing, rename, and reindexing, but lacks a delete/remove operation despite having rename, and no add/import tool (likely handled externally given reindex_pdfs). These are minor gaps an agent can work around for the stated purpose.
Maintenance
Related MCP Connectors
Serve a folder of Markdown notes as an MCP server: hybrid search, reading, and sourced answers.
Query your own PDFs and documents from any MCP client. Every answer cites the page it came from.
PDF AI for your own documents: ask from any MCP client and get answers that cite the source.
Agentic search over your Dewey document collections from any MCP-compatible client.
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceEnables any MCP-compatible AI assistant to search, filter, and retrieve information from a local document collection using a hybrid search pipeline with vector, BM25, reranking, and LLM enrichment.4-
- AlicenseAqualityCmaintenanceTurn any PDF folder into a searchable MCP server with semantic, hybrid, or keyword search.62MIT
- FlicenseAqualityCmaintenanceMCP server that enables semantic search over local PDF collections using local RAG, with automatic indexing of new documents.5-
- FlicenseNot gradedqualityDmaintenanceIndexes PDF documents into Qdrant and exposes semantic search as MCP tools, enabling RAG-based interactions with your documents.-