pdf-mcp
Extracts text and tables from PDFs for AI agents via MCP, enabling structured data retrieval from invoices, reports, and statements.
README
<!-- mcp-name: io.github.wesseltl/pdf-mcp -->
pdf-mcp
Let your AI agent pull text and tables out of PDFs. An MCP server for invoices, reports, and statements, where the data lives in tables the model can't read from a pasted blob.
When you paste a PDF into a prompt, the columns collapse and the table turns to mush, so the model guesses at the numbers. This extracts the actual table structure with deterministic code, so the agent gets clean rows and never invents a cell.
What it turns a PDF into
A PDF invoice table like this:
Item Qty Price
Widget 3 12.50
Gadget 1 40.00
Bolt 10 0.25
comes back as structured rows (or CSV), not a flattened line of text:
[["Item","Qty","Price"],["Widget","3","12.50"],["Gadget","1","40.00"],["Bolt","10","0.25"]]
The tools it gives an agent
| Tool | What it does |
|---|---|
page_count(path) |
How many pages the PDF has |
extract_text(path, page) |
Text per page (one page, or the whole doc) |
extract_tables(path, page) |
Tables as rows of cells |
table_to_csv(path, page, index) |
One table as clean CSV text |
Quickstart
pip install "pdf-agent-mcp[mcp]"
Add it to your MCP client (e.g. Claude Desktop):
{
"mcpServers": {
"pdf": { "command": "pdf-agent-mcp" }
}
}
Now your agent can answer "pull the line items out of this invoice" by reading the PDF, not guessing.
Also usable from plain Python
from pdf_mcp import extractor
extractor.extract_tables("invoice.pdf") # {'tables': [{'rows': [...]}], ...}
extractor.table_to_csv("invoice.pdf") # clean CSV of the first table
extractor.extract_text("report.pdf", page=1)
Tests
python -m unittest discover -s tests # builds its own test PDF, runs anywhere
License
MIT
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.