bank.mcp
MCP server that turns bank transactions into a financial digest including cash-flow forecast, spending breakdown, fee detection, and receipt reconciliation, exposing deterministic engines as JSON-RPC tools.
README
bank.mcp
A personal-finance analysis suite that turns a stream of bank transactions into a single digest — cash-flow forecast, savings-goal pace, spending breakdown, fee/duplicate detection, recurring-charge detection, and receipt reconciliation — rendered as both a Markdown/email digest and an auth-gated static web report.
The line it draws between the math and the LLM:
All financial math is plain, deterministic, unit-tested Python. A language model is used only to narrate a compact summary, match merchant-name strings, and extract text from receipt emails. Raw transaction rows never enter a model prompt — only small per-section summary dicts do. A
--no-voicerun is fully correct with zero tokens and no network.
It runs on the Python standard library only — zero runtime dependencies.
Status: a personal project, cleaned up as a work sample. All data in the repo is synthetic (
examples/,src/bank_mcp/demo.py); there is no real financial data here. 339 tests pass (75% coverage of the testable core);ruffandmypyare clean; CI runs lint + types + tests on Python 3.10–3.13.
What it produces
bank-mcp demo runs the whole pipeline on synthetic data and prints a digest:
# bank.mcp — UNIFIED MONTHLY DIGEST
## What matters
- Clear: balance stays at or above the $100.00 buffer for the full 35-day horizon
(min $1,087.44 on May 6, 2026).
- Fee/fraud: $49.99 recoverable this 30d.
## Cash-flow forecast
- Status: 🟢 CLEAR · Start $1,200.00 → projected end $4,188.00 (35d, buffer $100.00)
- Next income $800.00 from PAYROLL on May 7, 2026 · upcoming: May 26 Car Loan $285.00
bank-mcp analytics runs the SQL read-models over the store:
## Monthly cash flow
month income spend net running_net net_mom_change
2026-01 4000.0 945.05 3054.95 3054.95 None
2026-02 3200.0 681.31 2518.69 5573.64 -536.26
What this demonstrates
Beyond personal finance, the repo is meant to show transferable craft for data- and GTM-infrastructure work:
- Responsible data handling — local-first, read-only posture; credentials via env→Keychain (never committed); SSRF-guarded outbound HTTP; owner-scoped queries; zero secrets/PII in the tree or git history. Synthetic data only.
- Integration craft — a pluggable bank transport (bank-mcp fork / Plaid / snapshot) with graceful fallback, idempotent upsert keyed on transaction id, and retries with backoff on transient API failures.
- An MCP server (
bank-mcp-server) exposing the engines as JSON-RPC tools. - SQL analytics — CTE/window-function read-models (
store/queries.sql) cross-checked against a Python recompute. - Judgment about LLMs — deterministic, tested math with the model confined to the edges (narrate/match/extract), plus an opt-in trace of every model call.
- Observability, tests, types — structured logging, 339 tests, mypy, green CI.
Shape of the system
bank (Plaid / bank-mcp) ← real source, not committed
│
▼
ingest/ transport + sync ──────► store/ SQLite (canonical, lossless `raw` JSON)
│
▼
engines/ deterministic cores
(forecast · pace · fees · recurring · receipts)
│
▼ compact summary dicts (never raw rows)
report/ digest (md/email) + static site
▲
finance_agent.py ← orchestrator
│
LLM: narrate / match / extract (edges only)
The package layout mirrors that flow:
src/bank_mcp/
ingest/ safehttp · plaid_bridge · plaid_link · sync
store/ db (SQLite) · subscription_creep (field/cadence accessors) ·
obligation_registry · merchant_categorizer ·
analytics + queries.sql (SQL reporting read-models)
engines/ cashflow_forecaster · budget_scorer · fee_fraud_scan ·
recurring · receipt_scanner · dispute_agent · llm_matcher
report/ delivery · digest_templates · _report_sections · _report_styles ·
_report_format · email_html · build_site · web/
finance_agent.py # orchestrator: reconcile → run each engine → one digest
money.py # integer-cents money authority (rounding + formatting)
mcp_server.py # MCP server (the `bank-mcp-server` console script)
demo.py # synthetic data + `python -m bank_mcp demo`
_logging.py # structured logging + opt-in LLM-call trace + optional Sentry
__main__.py # `python -m bank_mcp` / the `bank-mcp` CLI
tests/ unit tests + a synthetic transaction fixture
examples/ copy-these config templates (synthetic)
ops/ launchd plist + deploy scripts (author-local)
docs/ ARCHITECTURE · SETUP · DECISIONS
Quickstart (two minutes)
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
bank-mcp demo # build + print a full digest from synthetic data
bank-mcp analytics # SQL reporting rollups (see src/bank_mcp/store/queries.sql)
pytest -q # 339 tests
ruff check src tests # lint
mypy # type-check the package
bank-mcp demo needs no bank credentials and no real data — it generates a
synthetic dataset and runs the whole pipeline end to end. To build the static
report site from a dataset:
python -m bank_mcp.report.build_site --balance 1200 --txns path/to/transactions.json
# writes ./site/ (index.html + report.html + assets)
Getting it working with your own bank
The demo above is the whole pipeline on synthetic data — it's complete on its own, so you can evaluate everything without connecting anything. Pointing it at a real bank is a deliberate, one-time setup step (there's no interactive prompt; it's config-driven), and all real-data files are gitignored so nothing real is ever committed.
# 1. Copy the templates and fill them in
cp examples/rules.example.md rules.md
cp examples/obligations.example.json obligations.json
cp examples/plaid_items.example.json plaid_items.json
# 2. Connect a bank (pick one transport — both live in src/bank_mcp/ingest/):
# a) direct Plaid — mint an access token for a bank Item, then set PLAID_ACCESS_TOKEN
python -m bank_mcp.ingest.plaid_link # one-time; prints a token to store in env/Keychain
# b) or a bank-mcp subprocess fork, which reads its own ~/.bank-mcp/config.json
# 3. Run the live sync + analysis (non-interactive; suitable for cron/launchd)
python -m bank_mcp.ingest.sync --status # show connection + sync state first
python -m bank_mcp.ingest.sync --monthly --balance 1200
Credentials resolve env var → macOS Keychain (PLAID_*, ANTHROPIC_API_KEY,
GMAIL_*) — nothing is hardcoded. Full details, including the optional auth-gated
static-site deploy, are in docs/SETUP.md.
Docs
- docs/ARCHITECTURE.md — layers, data flow, the SQLite schema, and the LLM boundary.
- docs/DECISIONS.md — why SQLite (not Postgres), the SQL/Python split, and what was left alone, and why.
- docs/SETUP.md — install, run, test, and the deploy model.
- CHANGES.md — what changed when this was prepared as a public work sample.
License
MIT — see LICENSE.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。