payment-reconciliation-mcp
Reconciles a vendor payment tracker CSV against a bank export CSV, categorizing discrepancies such as amount mismatches, unrecorded payments, and reversed transactions.
README
payment-reconciliation-mcp
An MCP server that reconciles a vendor payment tracker against a bank export and tells you exactly where the two disagree.
The problem
In most small finance operations, the payment tracker and the bank are two separate sources of truth that quietly drift apart. Invoices get marked paid that never cleared. Payments bounce back and nobody notices until the vendor emails. The same vendor appears as "Acme Office Supplies Inc" in the tracker and "ACH DEBIT ACME OFFICE SUPPLIES INV 10432" on the bank statement, so a spreadsheet lookup finds nothing.
The usual fix is a person reading two files side by side once a month. That person misses things, and the misses cost money — I have run this reconciliation manually across dozens of vendor accounts and found outstanding payments nobody had flagged.
This server hands that job to Claude. You point it at both files and ask what doesn't match.
What it does
Exposes three tools over MCP:
| Tool | Purpose |
|---|---|
load_tracker |
Parses a payment tracker CSV (vendor, invoice, amount, due date, status) |
load_bank_export |
Parses a bank export CSV (date, description, amount, reference) |
reconcile |
Matches the two and returns categorised discrepancies |
reconcile sorts every tracker row into exactly one of four primary buckets:
- Matched — tracker row and bank row agree on vendor and amount
- Amount mismatch — same vendor and invoice, different amount
- In tracker, not paid — invoiced in the tracker, no corresponding bank debit
- Paid, not in tracker — money left the account with no tracker entry
It then layers two independent flags on top, off to the side of the primary buckets:
- Returned / reversed — a bank line that looks like a reversal, return, refund, chargeback, NSF, or void
- Incomplete vendor records — a tracker row missing a vendor name, invoice number, amount, or due date
Vendor names are matched fuzzily, because bank descriptions are truncated, upper-cased, and suffixed with reference numbers. Exact-match reconciliation fails on real data.
Architecture
flowchart LR
A[Payment tracker CSV] --> C[MCP Server]
B[Bank export CSV] --> C
C -->|load_tracker| D[Normalised tracker rows]
C -->|load_bank_export| E[Normalised bank rows]
D --> F[Fuzzy vendor match<br/>+ amount compare]
E --> F
F --> G[Categorised discrepancy report]
G --> H[Claude]
The server does the deterministic work — parsing, normalising, matching — and leaves interpretation to the model. Reconciliation logic that decides whether $4,410.00 and $4,410 are the same number should not be probabilistic.
load_tracker and load_bank_export each hold their parsed rows in session state, so the normal flow is load → load → reconcile with no further arguments — reconcile reads whatever was last loaded. (You can still pass trackerPath/bankPath to reconcile to do it in a single call.) This state lives in the running process, not on disk; it does not survive a restart.
All diagnostic logging goes to stderr, never stdout, so it can never corrupt the JSON-RPC message stream the stdio transport carries on stdout.
Design decisions
Fuzzy matching over exact keys. Bank descriptions are not clean. Normalising case, stripping legal suffixes and payment-rail noise (inc, llc, ach, wire, payment), then scoring similarity catches the rows an exact join drops — and it matches on the numeric core of an invoice reference, so tracker invoice INI-4471 still ties to bank reference 4471 even when the bank prints the vendor as "INITEK SFTWR".
Amount tolerance is configurable, and defaults to one cent (0.01). The default absorbs sub-cent floating-point and rounding artifacts while still surfacing anything larger — a fee or an FX spread shows up as an amount mismatch for the caller to judge rather than being silently swallowed. Set it to 0 for exact-only, or raise it if small differences are expected. The vendor-name match threshold (nameThreshold, default 0.6) is configurable the same way.
Returned payments are their own category, not a mismatch. A reversal looks like a duplicate to a naive matcher. Treating it as its own case is the difference between a report someone acts on and one they ignore.
Nothing is written back. The server reads and reports. Anything that mutates a payment record belongs behind a human approval step.
No runtime dependencies beyond the MCP SDK. The server is built on @modelcontextprotocol/sdk (v1.30) over the stdio transport, and the CSV parser is written from scratch — it handles quoted fields, embedded commas and newlines, and accounting formats like $1,234.50 and (123.45) — so there is no third-party CSV library to trust or keep patched.
Setup
npm install
npm start
Add to your MCP client config:
{
"mcpServers": {
"payment-reconciliation": {
"command": "node",
"args": ["/absolute/path/to/payment-reconciliation-mcp/src/index.js"]
}
}
}
Try it
/samples contains fake tracker and bank export files with discrepancies deliberately planted — a mismatched amount, an unrecorded debit, a reversal, and vendors whose names differ across the two files.
Reconcile samples/payment_tracker.csv against samples/bank_export.csv
Expected output — 13 tracker rows against 13 bank rows:
Summary
matched 7
amount mismatches 2
in tracker, not paid 4
paid, not in tracker 2
returned / reversed 2 (flagged separately)
incomplete records 2 (flagged separately)
Matched (7)
Acme Office Supplies Inc, Northwind Traders LLC, Umbrella Logistics Ltd,
Wonka Packaging Co, Wayne Facilities Management, Cyberdyne Systems,
Initech Software (tracker INI-4471 ↔ bank ref 4471, "INITEK SFTWR")
Amount mismatches (2)
Globex Corporation tracker 975.00 bank 985.00 (+10.00)
Hooli Cloud Services tracker 8990.00 bank 8900.00 (-90.00)
In tracker, not paid (4)
Stark Industrial Supply, Soylent Foods Group, Pied Piper Data, Vandelay Imports
Paid, not in tracker (2)
OSCORP INDUSTRIES (OSC-0012), ZOOMINFO DATA (ZI-5560)
Returned / reversed (2)
Vandelay Imports (VAN-3311), Soylent Foods Group (SOY-6612, NSF)
Incomplete vendor records (2)
Cyberdyne Systems (missing invoice), Pied Piper Data (missing amount)
The three primary buckets — matched (7) + amount mismatches (2) + in tracker, not paid (4) — sum to all 13 tracker rows; every invoice is accounted for exactly once. The returned/reversed and incomplete-record lists are orthogonal flags layered on top: Vandelay and Soylent show up as not paid because their only bank line was a reversal, and Cyberdyne is both matched and flagged for a missing invoice number.
Verified
npm test
node:test suite, 4/4 passing — covering amount parsing, name normalisation, fuzzy similarity, and a full reconciliation over the sample fixtures that asserts each bucket and flag lands where expected.
Not in scope
- No bank API integration; this reads exported files on purpose, because that is what finance teams actually have
- No multi-currency handling yet
- No persistence to disk — loaded files are cached in memory for the life of the session and are gone on restart
Why I built it
I run financial and payment operations for US companies from Nairobi, across Bill.com, ACH, checks, and wires. Vendor reconciliation is the task I have done most often by hand and trusted least. This is that task, automated, using the tooling I would reach for at work.
Built with Node and the Model Context Protocol SDK.
License
MIT
Mary Ogola — AI automation and business systems. LinkedIn
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。