docuclean-ledger-mcp is an MCP server for AI coding and financial agents. The repository uses the MIT license, requires Node.js 20 or later, and supports three transport methods: stdio, Streamable HTTP, and SSE. Its purpose is to solve common agent issues such as arithmetic hallucinations, CJK CSV mojibake, and CSV/DDE formula injection when processing bank statements, invoices, and tables. The project states that it does not depend on external large model APIs and provides three core tools.
Uses and main capabilities:
-
reconcile_statements_and_invoices: reconciles Alipay, WeChat Pay, Stripe, PayPal, and bank CSV/JSON statements with e-invoices (Chinese fully digitalized e-invoice XML/PDF, UBL 2.1 XML, CSV, JSON). It uses exact BigInt micro-unit arithmetic (10,000n = 1.00). It supports 1:1 order number and merchant reference matching, counterparty entity alias plus date-window matching (e.g., Didi and Beijing Xiaoju Technology Co., Ltd., Alibaba Cloud and Alibaba Cloud Computing), cross-currency exchange-rate card-difference matching (USD/EUR/HKD against CNY), bounded combination N-to-1 subset-sum matching (consolidated invoicing to make up an order), duplicate transaction and invoice interception, and buyer taxpayer identification number compliance validation. It outputs structured JSON, UTF-8 BOM CSV that meets OWASP formula security requirements, and a Base64-encoded three-worksheet OpenXML .xlsx audit workbook (01_Executive_Summary, 02_Reconciled_Ledger, 03_Anomalies_Checklist).
-
extract_and_clean_pdf_tables_to_xlsx: extracts tables from multi-page PDF binaries (PyMuPDF vector/spatial grid plus pure JS FlateDecode/CMap fallback), HTML (two-dimensional expansion of rowspan/colspan), Markdown, JSON/JSONL, or messy CSV; stitches repeated headers across pages; removes illegal XML 1.0 control characters; keeps user cells non-formula (inlineStr), and appends live =SUM() and =AVERAGE() summary rows; outputs Base64 .xlsx, Markdown, and UTF-8 BOM CSV.
-
repair_cjk_csv_mojibake: detects and repairs garbled CSV/TSV from GB18030, GBK, Big5, Shift_JIS, EUC-KR, UTF-16LE/BE, and UTF-8 mistakenly treated as Latin1/Windows-1252 double encoding; repairs unquoted thousands-separator commas in currency values; protects long numeric IDs of 15 or more digits and leading zeros; neutralizes OWASP CSV/DDE formula injection (=, +, -, @).
Usage:
Local stdio mode can be run via npx with zero installation or by cloning the repository, and is suitable for clients such as Claude Desktop, Cursor, Windsurf, Cline, Cherry Studio, and n8n. Cloud hosting provides a Streamable HTTP endpoint https://docuclean-ledger-mcp.mcpize.run/mcp(MCPize x402 Base USDC pay-per-use micropayments), and can also be used via the Apify Store Actor; the Apify Standby endpoint is https://shulang-chen--docuclean-ledger-mcp.apify.actor/mcp,需携带 Authorization: Bearer <APIFY_TOKEN>.
Billing: The project uses an event-based pay-per-use model. The prices listed in the materials are $0.02 per run for reconcile_statements_and_invoices, $0.02 per document for extract_and_clean_pdf_tables_to_xlsx, and $0.005 per file for repair_cjk_csv_mojibake; MCPize Cloud is labeled as x402 Base USDC at $0.01–$0.02 per call. Failed or invalid tool calls are not charged.
Use cases: financial and reimbursement reconciliation, merging invoices to combine orders for verification/write-off, converting multi-page PDF tables to Excel, cleaning and secure handling before importing Chinese/Japanese/Korean CSV files, and agent workflows that require deterministic computation rather than LLM inference.
Limitations: The materials do not provide the full text of specific installation commands, detailed input parameter examples for each tool, performance and data scale limits, data privacy and storage policies, refund policy, SLA, or other information, and such information is not currently available. The repository description also lists blockchain-related tools such as validate_multichain_address, decode_and_audit_evm_calldata, and audit_eip712_signature_payload, but the Chinese introduction only covers the three core tools; the specific capabilities and billing of the remaining tools are not described in detail in the materials.