DocuClean Ledger MCP
Pricing
Pay per usage
DocuClean Ledger MCP
Deterministic MCP server for statement-invoice reconciliation, PDF table extraction to XLSX, and CJK CSV mojibake repair.
Pricing
Pay per usage
Rating
0.0
(0)
Developer
Shulang Chen
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
12 hours ago
Last modified
Categories
Features
Share
DocuClean & LedgerClean MCP (docuclean-ledger-mcp)
Deterministic Financial Reconciliation, Multi-Page PDF-to-Excel Extraction & CJK CSV Mojibake Repair — Commercial MCP Server & Pay-Per-Event Apify Actor
AI coding and finance agents routinely hallucinate arithmetic on bank statements, corrupt Chinese/Japanese/Korean (GB18030 / GBK / Big5 / Shift_JIS) CSV exports, or produce broken spreadsheets vulnerable to CSV/DDE formula injection. docuclean-ledger-mcp gives Claude Desktop, Cursor, Windsurf, Cline, n8n, and API workflows three deterministic, security-hardened tools with zero external LLM API dependencies:
reconcile_statements_and_invoices($0.02/ run) — Reconciles Alipay (支付宝), WeChat Pay (微信支付), Stripe, PayPal, and bank CSV/JSON statements against electronic invoices (China Digital e-Invoice数电票XML/PDF, UBL 2.1 XML, CSV, JSON) using exactBigIntmicro-unit (10,000n = 1.00) arithmetic:- 1-to-1 Order-ID & Merchant-Ref matching
- Counterparty entity alias + date-window matching (
滴滴↔北京小桔科技有限公司,阿里云↔阿里巴巴云计算, etc.) - Cross-currency FX card spread matching (
USD/EUR/HKD↔CNY) - Bounded combinatorial N-to-1 subset-sum matching (
合并开票凑单, e.g., multiple ride-hail or cloud charges matching a single consolidated monthly tax invoice) - Duplicate transaction/invoice blocking + Buyer Tax-ID (
纳税人识别号) compliance verification - Outputs structured JSON + OWASP formula-safe UTF-8 BOM CSV + Base64 3-sheet OpenXML
.xlsxAudit Workbook (01_Executive_Summary,02_Reconciled_Ledger,03_Anomalies_Checklist)
extract_and_clean_pdf_tables_to_xlsx($0.02/ document) — Extracts tables from multi-page PDF binaries (PyMuPDFvector/spatial grid + pure-JS FlateDecode/CMap fallback), HTML (rowspan/colspan2D expansion), Markdown, JSON/JSONL, or messy CSVs; stitches repeating headers across page breaks; strips illegal XML 1.0 control characters (\x00–\x08,\x0B,\x0C,\x0E–\x1F); keeps user cells strictly non-formula (inlineStr) while appending live=SUM()and=AVERAGE()summary rows; and outputs Base64.xlsx+ Markdown + UTF-8 BOM CSV.repair_cjk_csv_mojibake($0.005/ file) — Detects and repairs garbled CJK CSV/TSV files fromGB18030,GBK,Big5,Shift_JIS,EUC-KR,UTF-16LE/BE, and double-encodedUTF-8-as-Latin1/Windows-1252strings; heals unquoted currency thousands commas (¥1,250.00); armors 15+ digit IDs and leading zeros; and neutralizes OWASP CSV/DDE formula injection (=,+,-,@).
Pay-Per-Event Pricing
| Event / Tool | Event Name | Flat Price (USD) | Typical Latency |
|---|---|---|---|
reconcile_statements_and_invoices | reconcile-statements-invoices | $0.020 | 30–180 ms |
extract_and_clean_pdf_tables_to_xlsx | extract-pdf-tables-to-xlsx | $0.020 | 50–250 ms |
repair_cjk_csv_mojibake | repair-cjk-csv-mojibake | $0.005 | 5–25 ms |
| Batch Cold-Start Initialization (Batch mode only) | actor-start | $0.001 | <50 ms |
Failed or invalid tool calls are never charged.
Quick Connect — Hosted MCP (Apify Standby & MCPize)
1. Streamable HTTP MCP (Claude Desktop / Cursor / Windsurf / Inspector)
{"mcpServers": {"docuclean-ledger": {"type": "streamable-http","url": "https://2848823170--docuclean-ledger-mcp.apify.actor/mcp","headers": {"Authorization": "Bearer <YOUR_APIFY_API_TOKEN>"}}}}
2. Local stdio Mode (npx / Node 20+)
{"mcpServers": {"docuclean-ledger": {"command": "node","args": ["./src/main.mjs", "--stdio"]}}}
Tool Input Examples
reconcile_statements_and_invoices
{"statements": [{"filename": "alipay_2026_11.csv","content": "交易创建时间,交易对方,商品说明,收/支,金额(元),交易状态,交易订单号\n2026-11-05,阿里云计算有限公司,ECS云服务器,支出,368.00,交易成功,202611050001"}],"invoices": [{"filename": "einvoice_aliyun.xml","content": "<ElectronicInvoice><InvoiceNumber>26312000000088990011</InvoiceNumber><IssueTime>2026-11-06</IssueTime><SellerInformation><SellerName>阿里云计算有限公司</SellerName></SellerInformation><TotalTax-includedAmount>368.00</TotalTax-includedAmount></ElectronicInvoice>"}],"baseCurrency": "CNY"}
extract_and_clean_pdf_tables_to_xlsx
{"filename": "procurement_schedule.pdf","contentBase64": "<BASE64_PDF_BYTES>","mergePages": true,"dedupeRows": true,"injectFormulas": true}
repair_cjk_csv_mojibake
{"filename": "legacy_gbk_export.csv","contentBase64": "<BASE64_GB18030_OR_BIG5_BYTES>"}
Local Development & Verification
# Run full unit, OpenXML openpyxl cross-validation, stdio MCP, HTTP Standby MCP & Batch Actor suitenpm test# Start Streamable HTTP + SSE MCP server on http://localhost:8080/mcpnpm run start:http# Start stdio MCP servernpm run start:stdio
