Why an MCP server for PDF extraction
Bookkeeping & accounting
Convert client bank and credit-card statements into Excel ready for reconciliation, without uploading sensitive ledgers.
Accounts payable
Pull invoice line items into structured records for ERP or spreadsheet workflows, with vendor and amounts intact.
AI agents & RAG
Give Claude Desktop, Cursor or any MCP client a callable tool that returns clean tables instead of noisy page text.
Compliance-safe sharing
Mask account numbers and IDs before a file ever leaves the firm, with selectable redaction levels.
What it does
- extract_pdf — feed a digital PDF (base64 or URL) and get table rows back as CSV, JSON records or XLSX.
- health — service status and free-tier limit information.
- Three-strategy table detection per page: ruled tables → explicit columns derived from the header's own x-positions (handles borderless Western bank statements) → generic text alignment.
- Automatic PII redaction covering SSN/EIN/TIN, IBAN, SWIFT/BIC, routing/ABA, account and card numbers, phone, email, plus Chinese national ID, bank card, USCC and passport.
- Ambiguous bare numbers masked only after a label, so reference numbers, dates and amounts stay readable and accurate.
- Scanned/image-only PDFs explicitly rejected (
SCANNED_PDF_UNSUPPORTED) — never a silent failure or surprise OCR charge.
Install and connect
Published to the official MCP Registry as io.github.diyaluo/pdf-extract-mcp and as an OCI image on GHCR. Run locally over stdio:
pip install -e .
pdf-extract-mcp
Client configuration (Claude Desktop / Cursor / any MCP client):
{
"mcpServers": {
"pdf-extract": {
"command": "pdf-extract-mcp",
"env": {}
}
}
}
Frequently asked questions
What does this MCP server do?
It exposes PDF data extraction as MCP tools, so any MCP-compatible AI agent can take a digital PDF bank statement, invoice or bill and return its tables as CSV, JSON records or an Excel workbook, with sensitive PII masked by default.
Does it upload my PDFs to a server?
No. The server runs locally and communicates over stdio. PDF content and extracted data never leave the computer, which is why teams handling confidential client financial documents use it instead of online OCR websites.
Which MCP clients is it compatible with?
Any client that supports the Model Context Protocol over stdio, including Claude Desktop and Cursor. It is published to the official MCP Registry as io.github.diyaluo/pdf-extract-mcp and distributed as an OCI image on GHCR.
Can it read scanned or image-only PDFs?
No. Scanned or image-only PDFs are explicitly rejected with a structured SCANNED_PDF_UNSUPPORTED response rather than silently failing or triggering paid OCR. The current scope is digital, text-layer PDFs; OCR is a planned separate tier.
What sensitive data is redacted?
By default it masks SSN, EIN/TIN, IBAN, SWIFT/BIC, routing/ABA and account numbers, card numbers, phone and email, plus Chinese national ID, mobile, bank card, USCC and passport numbers. Ambiguous bare numbers are masked only after a label so reference numbers and amounts stay readable; amounts, dates and descriptions are never altered.