ledgerbridge-mcp
Parses Alipay GB18030/UTF-8 CSV statement exports, including the 24-line metadata header, and reconciles their transactions and refunds for export.
Parses Chase bank CSV statements and reconciles them with other accounts, including cross-account transfer deduplication and refund netting.
Exports OFX 2.2 XML with deterministic SHA-256 FITIDs so QuickBooks can import reconciled transactions without duplicates.
Parses Revolut CSV statements and reconciles them with other accounts for transfer- and refund-aware exports.
Parses WeChat Pay CSV statements, including embedded partial-refund statuses, and nets refunds against original purchases.
Parses Wise CSV statements and reconciles them with other accounts for transfer- and refund-aware exports.
Exports OFX 2.2 XML with deterministic SHA-256 FITIDs so Xero can import reconciled transactions without duplicates.
ledgerbridge-mcp — Offline Multi-Bank, Alipay (GB18030) & WeChat Statement Reconciler + OFX 2.2 / Beancount / YNAB MCP Server, CLI & GitHub Action
Zero-dependency, 100% offline Model Context Protocol (MCP) Server, CLI, and GitHub Action enabling AI coding and finance agents (Claude Desktop, Claude Code, Cursor, Windsurf, Antigravity) and pull-request CI pipelines to deterministically reconcile Chase / Amex / Revolut / Wise / CMB bank CSVs, Alipay (GB18030 24-line header) CSVs, WeChat Pay CSVs (including embedded 已部分退款(¥X.XX) statuses), and copy-pasted PDF statement text using exact BigInt integer-cent math (0 IEEE-754 floating-point drift)—deduplicating cross-account credit card repayments and wallet withdrawals, netting full/partial refunds, and exporting lossless OFX 2.2 XML, Beancount (.bean), hledger (.journal), YNAB Import .csv, and QIF.
MCP Tools Exposed (stdio)
Tool | Purpose | Safety Annotations |
| Parses one or more bank CSVs, Alipay ( |
|
| Inspects multi-account statement inputs to report matched cross-account transfer pairs ( |
|
| Audits |
|
| Computes deterministic SHA-256 |
|
Related MCP server: Statement Normalizer
Quick Start (MCP Client & Local CLI)
# Start MCP server over stdio (supports both NDJSON and Content-Length framing)
npx -y github:z121245017-ai/ledgerbridge-mcp
# List MCP tool schemas from terminal
npx -y github:z121245017-ai/ledgerbridge-mcp --list
# Reconcile multiple bank / Alipay (GB18030) / WeChat files offline to Beancount or OFX 2.2
npx -y github:z121245017-ai/ledgerbridge-mcp --input ./alipay.csv --input ./cmb_debit.csv --export beancount --output ./2026.bean
# Audit a Beancount or hledger file for unbalanced postings (exits 2 if unbalanced)
npx -y github:z121245017-ai/ledgerbridge-mcp --audit-ledger ./books/2026.bean
# Invoke any MCP tool directly via --cli
npx -y github:z121245017-ai/ledgerbridge-mcp --cli generate_deterministic_ofx_fitids '{"account":"Assets:Bank:Chase","items":[{"date":"2026-11-15","amount":"-32.50","payee":"Starbucks"}]}'Claude Desktop / Cursor / Windsurf / Antigravity Config
{
"mcpServers": {
"ledgerbridge": {
"command": "npx",
"args": ["-y", "github:z121245017-ai/ledgerbridge-mcp"]
}
}
}Docker (node:22-alpine, non-root USER node)
docker build -t ledgerbridge-mcp .
docker run -i --rm ledgerbridge-mcpGitHub Action (z121245017-ai/ledgerbridge-mcp@v1)
Enforce exact BigInt zero-cent trial-balance integrity across plain-text accounting repositories (.bean, .beancount, .journal, .hledger) and statement fixtures on every pull request:
name: LedgerBridge Double-Entry Gate
on:
pull_request:
paths:
- '**/*.bean'
- '**/*.beancount'
- '**/*.journal'
- '**/*.csv'
permissions:
contents: read
jobs:
ledgerbridge:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify zero-cent double-entry balance
uses: z121245017-ai/ledgerbridge-mcp@v1
with:
paths: 'ledgers,fixtures'
transfer-window-hours: '48'Accounting Fidelity & Format Matrix
Capability | Deterministic Engine Guarantee | Downstream Software Compatibility |
Binary Encoding ( | Automatic | Direct Alipay & Chinese bank |
Cross-Account Transfers | Pairs | Eliminates inflated double-counted credit card & wallet spend |
Partial & Full Refunds | Links | Credits original |
OFX 2.2 Idempotency | Deterministic SHA-256 | QuickBooks, Xero, Wave, GnuCash duplicate-safe import |
Plain-Text Accounting |
|
|
Commercial Air-Gapped Browser Workbench & Multi-Account Closing Suite
Need a zero-install Bilingual Air-Gapped Browser Workbench (connect-src 'none') for drag-and-drop multi-file statement reconciliation, interactive OFX 2.2 / Beancount / YNAB / QIF tabs, BOM-prefixed Excel/WPS pivot tables, and 1080×1440 reconciliation sign-off cards without touching the command line?
Explore LedgerBridge Pro Workbench and our full offline engineering & finance utility catalog at https://z121245017-ai.github.io/.
Verification
npm testLicense
MIT License — 0 external npm dependencies, 0 network calls, 100% local deterministic BigInt execution.
Available Tools
4 toolsaudit_double_entry_ledger_balanceARead-onlyIdempotent
Audits Beancount (.bean) or hledger (.journal) double-entry ledger text offline using exact BigInt minor-unit math to verify that every transaction satisfies SUM(postings) === 0 without floating-point drift.
Inputs: filePath, filename, ledgerText.
detect_cross_account_transfers_and_refundsBRead-onlyIdempotent
Analyzes multi-account bank, Alipay, and WeChat Pay statements offline to identify matched cross-account internal transfers, linked partial/full refunds, and exact BigInt Naive Outflow vs Gross Spend vs True Net Spend.
Inputs: content, statements, refundWindowDays, transferWindowHours.
generate_deterministic_ofx_fitidsARead-onlyIdempotent
Generates deterministic SHA-256 OFX 2.2 FITID keys (LB<22HEX>) for statement rows so QuickBooks, Xero, Wave, and GnuCash remain duplicate-safe across re-imports while preserving distinct IDs for identical same-day purchases.
Inputs: items (required), account, currency.
reconcile_and_convert_statementsARead-onlyIdempotent
Parses one or more bank CSVs (Chase, Amex, Revolut, Wise, CMB), Alipay (GB18030/UTF-8) CSVs, WeChat Pay CSVs, or pasted PDF statement blocks offline, deduplicates 0-48h cross-account transfers, nets 30d partial/full refunds, proves SUM(postings) === 0 in BigInt cents, and exports OFX 2.2, Beancount, hledger, YNAB, QIF, or Master CSV.
Inputs: content, filePaths, statements, exportFormat, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Tools 1-3 have clearly distinct, narrow purposes (transfer/refund detection, ledger balance auditing, FITID generation), but tool 4 (reconcile_and_convert_statements) explicitly performs all of those operations plus parsing and export, making it a superset that overlaps every other tool. An agent can reasonably be unsure whether to call the focused tools first or just use the composite one, and whether the focused tools are meant as standalone or internal steps.
All names are snake_case and verb-first (detect_, audit_, generate_, reconcile_), so the convention is predictable. The minor deviation is structural: two names are multi-clause with 'and' conjunctions and qualifiers (detect_cross_account_transfers_and_refunds, reconcile_and_convert_statements) while the others are single verb-object phrases, making lengths and shapes less uniform.
Four tools is a reasonable, well-scoped surface for a statement-reconciliation server, and each focus tool earns its place as a distinct analysis primitive. The only concern is granularity asymmetry: one tool bundles parsing, dedup, refund netting, balance proving, and multi-format export, so the effective surface is coarser than the count suggests.
Coverage is strong for the stated domain: multi-source ingestion (bank CSV, Alipay, WeChat, PDF blocks), dedup/refund netting, double-entry validation, stable FITIDs, and export to OFX/Beancount/hledger/YNAB/QIF/CSV. Minor gaps exist around multi-currency FX handling, ledger write/edit operations, and ongoing incremental (append to existing ledger) workflows.
Maintenance
Related MCP Connectors
Normalize bank statements (CSV, camt, MT940, OFX, QIF) to JSON, analyze, export.
Normalize bank statements (CSV, camt, MT940, OFX, QIF) to JSON, analyze, export.
Deterministic bank-statement parsing: messy CSV/OFX to clean categorized rows. In-memory only.
Convert PDF bank statements to Excel, CSV, QBO, OFX with a per-row running-balance check.
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables local-first personal finance management through deterministic tools for importing, categorizing, and analyzing bank transactions.36MIT
- AlicenseNot gradedqualityBmaintenanceDeterministic bank-statement parsing for AI agents: messy CSV/OFX exports to clean, categorized ledger rows. In-memory only, no storage, no external calls, no LLM in the loop.MIT
- AlicenseAqualityBmaintenanceProvides tools to read Money Lover account data and add transactions, with features for previewing, duplicate detection, reconciliation, and safe batch import of bank/card statement JSON via an MCP client.8MIT
- AlicenseNot gradedqualityBmaintenanceEnables parsing of structured receipts, invoices, and bank statements and tolerance-based three-way reconciliation that detects tax calculation drift and duplicate claims, then synthesizes balanced double-entry bookkeeping journal entries. Exposes these capabilities as MCP tools (initialize, tools/list, tools/call) over a dependency-free JSON-RPC 2.0 stdio server.7MIT