Pdf Extract Mcp

io.github.diyaluo由 GitHub 账号 diyaluo 发布v0.3.0更新于 Oct 24, 2026

Digital PDF invoices/bank statements to CSV, JSON or Excel with automatic PII redaction.

已验证STDIO仅桌面文件与存储数据与分析

概览

AI 生成的概览

本地 MCP 服务器,从发票、银行对账单等数字 PDF 中提取表格和文本,输出 CSV、JSON 或 Excel,并自动脱敏个人隐私信息。

可以做什么
从以 base64 或直接 https 链接提供的数字 PDF 中提取表格和文本,返回 CSV、JSON 记录或 XLSX 文件;表格识别按页尝试有线表格、依据表头列位置推导列以及通用文本对齐三种策略。默认脱敏个人与金融标识,涵盖美国及国际的 SSN、IBAN、SWIFT、路由号、卡号、电话和邮箱,以及中国的身份证、手机号、银行卡、统一社会信用代码、护照和人名。查询服务状态和免费额度限制。金额、日期和描述保持不变,扫描件或纯图片 PDF 会被拒绝。
适用场景
适用于手头有发票、银行对账单或账单的文本层 PDF,希望助手将其转换为结构化行以便放入表格或后续处理,同时避免暴露个人数据。不适合扫描件或纯图片文档。
运行要求
以本地 stdio 进程运行;README 使用 pip 安装,需要 Python 3.10+、mcp、pdfplumber 和 openpyxl,pandas 为可选。另提供远程 streamable-http 模式。未声明身份验证;可选的 PDF_EXTRACT_API_KEY 用于付费层级,PDF_EXTRACT_STATE_DIR 可覆盖遥测文件位置。
安装前请注意
免费额度为每个客户端滚动 30 天内 100 页、单文件 50 MB;超额时返回配额错误而不会计费。通过链接提供的 PDF 会从该地址下载,内容会离开本机。每次调用都会追加到本地使用日志,客户端以加盐哈希记录;README 称不记录 PDF 内容和个人信息。脱敏默认开启,但可以关闭。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Pdf Extract Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

pdf-extract-mcp

A Model Context Protocol (MCP) server that extracts tables and text from digital (text-layer) PDFs — bank statements, invoices, bills — into CSV / JSON / Excel, with automatic PII redaction.

Part of the invoice-extractor product. This package is the MCP distribution channel ("ecosystem parasite": one backend, many host workflows). Web demo lives in the parent project.

What it does

  • extract_pdf — upload a digital PDF (base64 or URL), get back structured table rows as CSV / JSON records / XLSX.
  • health — service status and free-tier limits.

Table detection tries three strategies per page: ruled tables → explicit columns derived from the header row's own x-positions (handles statement PDFs with no grid lines, the common case for Western banks) → generic text alignment.

PII redaction (on by default) covers:

RegionMasked
US / internationalSSN, EIN/TIN, IBAN, SWIFT/BIC, routing/ABA, account numbers, card numbers (plain and 4111 1111 1111 1111 / dashed), US & international phone, email
China18/15-digit national ID, mobile phone, bank card, USCC (统一社会信用代码), passport, 2–3 char personal names, organization keywords

Bank identifiers that are ambiguous as bare numbers (routing/account/sort code) are masked only when they follow a label, so reference numbers and amounts stay readable. Amounts, dates and descriptions are never altered.

Scanned / image-only PDFs are explicitly rejected (SCANNED_PDF_UNSUPPORTED) — the free tier covers digital PDFs only (OCR is a paid-tier candidate).

Limits (free tier)

  • 100 pages / rolling 30 days / client (anonymous, keyed by client hash).
  • 50 MB per file.
  • Above quota the tool returns a structured QUOTA_EXCEEDED response with an in-band upgrade pointer. It never silently bills.
  • Set PDF_EXTRACT_API_KEY to a paid key to bypass the quota (billing gateway is a P1 item; current free tier has no paid keys issued).

Run (local stdio — Claude Desktop / Cursor / any MCP client)

bash
pip install -e .pdf-extract-mcp

Client config example:

json
{  "mcpServers": {    "pdf-extract": {      "command": "pdf-extract-mcp",      "env": {}    }  }}

Run (remote streamable-http, for hosted MCP clients)

bash
REMOTE_TRANSPORT=http MCP_HOST=127.0.0.1 MCP_PORT=5060 \  python -m pdf_extract_mcp.server# POST JSON-RPC to http://127.0.0.1:5061/mcp

Tool schema

extract_pdf(  pdf_base64: str | None,     # preferred: PDF bytes as base64  pdf_url:    str | None,     # alternative: direct https .pdf URL  output:     "csv"|"json"|"xlsx",   # default csv  redact_pii: bool = true,  api_key:    str | None,    # paid key, optional) -> {  ok, type: "tables"|"text", pages, tables, rows, columns,  csv | rows_json | xlsx_base64,   # depends on output  elapsed_ms}

Telemetry

Every call is appended (best-effort, never blocks extraction) to ~/.cache/pdf-extract-mcp/mcp_usage.jsonl (override with PDF_EXTRACT_STATE_DIR). Clients are recorded as salted hashes; no PDF content and no PII are ever logged.

Note: as a distributed stdio bundle this file lives on the user's machine, so the publisher cannot read it. Real external usage is read from the hosting registry's owner API instead (GET /servers/{namespace}/{name}/logs on Smithery returns the invocation count).

Stack

mcp >= 1.2 (works on both mcp 1.x FastMCP and mcp 2.x MCPServer), pdfplumber, openpyxl. pandas is optional — when absent the package falls back to a lightweight list-of-rows table (stdlib CSV/JSON + openpyxl), which keeps the distributable bundle small. Python 3.10+.

License

MIT

来源:README.md,提交 0c3e59d

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

2
  1. v0.3.0最新Oct 17, 2026
  2. v0.1.0Oct 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分