MoneyFlow MCP Server
This is a read-only MCP server for a personal finance ledger; it answers spending and budget questions over a Postgres-backed ledger.
Category spending (
spending): signed kept amount per currency for one category over an inclusive date range.Category breakdown (
category_totals): totals per category, subcategory and currency, either for a date range or for one budget month (YYYY-MM, not both).Transaction search (
find_transactions): transactions plus their ledger entries, filtered by date range, optional account and a case-insensitive substring of description or comment, with a limit (default 20).Budget cycle overview (
month_summary): dates, days total and left, income and actual totals per currency (never merged into one number) and cash in hand; defaults to the open cycle.All tools only read data — nothing is written to the ledger.
Provides read-only tools for querying a personal finance ledger stored in a PostgreSQL database, enabling retrieval of category totals, transaction lookups, monthly budget summaries, and per-category spending over date ranges or budget months.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MoneyFlow MCP Server show my spending by category last month"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MoneyFlow
Personal finance ledger. It has a pure core, Postgres storage and read-only MCP tools.
moneyflow.core: pure ledger build (ingest, categorize, arithmetic). It does no I/O.moneyflow.storage: Postgres via SQLAlchemy, with Alembic migrations.moneyflow.services: rebuilds the stored ledger and runs queries.moneyflow.api: an MCP server over stdio that exposes read-only tools.
Status: early (0.x). The API and the schema can change between minor versions.
Requirements
Python 3.12+
Postgres 16. Docker works.
Related MCP server: slcg
Quick start
git clone https://github.com/FreddieMcHeart/moneyflow.git
cd moneyflow
uv sync
./local.sh up # needs MF_OLD_REPO in .env, see "Local environment" below
export MONEYFLOW_DATABASE_URL=postgresql://postgres:<POSTGRES_PASSWORD from .env>@localhost:5434/moneyflow_dev
uv run python -m moneyflow rebuild --db "$MONEYFLOW_DATABASE_URL"
uv run python -m moneyflow mcp --db "$MONEYFLOW_DATABASE_URL"Run the app locally
Needs Node 22 with npm, uv, and Docker or Podman. Run from the repo root.
./local.sh upIt brings up Postgres, MongoDB and Metabase, imports both stores, builds the UI and serves the app on http://127.0.0.1:8765 over MongoDB (see "Local environment" below). The database URL comes from .env, so there is no password to type. Ctrl+C stops it.
To serve again without the import:
./local.sh webFor fake data, with no database and no .env:
./local.sh web --mockOpen the URL Vite prints (http://localhost:5173 by default).
Both up and web run npm ci in web/ first when web/node_modules is missing.
Local environment
A Postgres, a MongoDB and a Metabase in containers, filled from the old repo, with three dashboards. Everything it stores lives under .local/ (gitignored).
Prerequisites: docker (or podman; set MF_COMPOSE="podman compose") and uv.
cp .env.example .env # optional: `./local.sh up` creates .env with random passwords if it is missing
./local.sh upIn
.env, setMF_OLD_REPOto the path of the old repo (it is only read, never copied or changed). local.sh refuses to run without it../local.sh upstarts the containers, migrates both stores, imports and rebuilds into Postgres and MongoDB, provisions Metabase, builds the UI and serves the app on MongoDB. Run it again at any time: the import is incremental and prints inserted / updated / deleted / unchanged counts per table.
Command | What it does |
| start everything, migrate both stores, import and rebuild into both, provision Metabase |
| import and rebuild into both stores only (containers must be running) |
| containers, schema revision, row counts (Postgres and MongoDB), Metabase health |
| stop the containers; data stays in |
| build the web UI and serve it with the JSON API on |
| the web UI on fake data in the Vite dev server, no database |
URLs. Postgres on
localhost:5434(databasemoneyflow_dev), Metabase onhttp://localhost:3000. Both ports are set in.env(MF_PG_PORT,MF_MB_PORT).MongoDB.
localhost:27018(databasemoneyflow_dev), set byMF_MONGO_PORTin.env(MF_MONGO_URLin the environment overrides the whole URL); no authentication, published on 127.0.0.1 only. Compare the two stores withpython -m tools.store_compare --pg <postgres url> --mongo <mongo url>.Metabase first login. Use
MB_ADMIN_EMAILandMB_ADMIN_PASSWORDfrom.env.Dashboards. The JSON definitions are in
deploy/metabase/dashboards/(This cycle, Months, Transactions). They are native SQL cards plus pivot cards over them (By category,History by month,Transactions by category); the Transactions filters map to pivot fields. Everything is upserted by name into the collection "MoneyFlow (provisioned)". Edits made in the Metabase UI inside that collection are overwritten by the nextup; change the JSON instead.Reset. There is no reset command:
./local.sh stop, then delete.local/by hand. The next./local.sh uprecreates the bind directories under.local/before it starts the containers.Passwords.
uprefuses to start while a password in.envis empty or stillchange-me; the message names the key only. Both ports are published on127.0.0.1only.Runtimes. The local environment was tested on podman only, not on Docker Desktop.
Memory. Metabase runs with JAVA_OPTS="-Xmx384m -XX:+UseSerialGC -XX:ReservedCodeCacheSize=64m -Xss512k -XX:TieredStopAtLevel=1" in deploy/compose.yml; the measured numbers are below.
Podman VM. The podman VM needs 4 GB: podman machine set --memory 4096 (the machine must be stopped first).
Podman VM memory, measured. Measured 2026-11-07 on a 4 GB podman VM (3.9 GB usable): peak Metabase java RSS about 900 MB during provisioning, VM used about 1.5 GB of 3.9 GB after up.
OOM check. On podman, run
podman machine sshthendmesg | grep -i 'killed process'; any line means the VM killed a process for memory.podman without a socket file. If the host has no podman API socket file, compose can reach the machine's socket over ssh: forward the machine's
/run/podman/podman.sockto a local unix socket withssh -L, and pointDOCKER_HOSTat that local socket.
Which Postgres
Postgres | Port | Databases | Used for |
| 5433 |
| the test suite only |
local environment ( | 5434 |
| development data and Metabase |
Tests never use moneyflow_dev. mf-pg stays as it is; nothing here deletes it.
Metabase licence
Metabase is released under the AGPL. This repo only references the image metabase/metabase by tag in deploy/compose.yml; the image is not shipped or copied here, and this repo stays MIT.
Use from Claude Code
The MCP server is read-only and talks to the local database. Take MF_READER_PASSWORD from .env:
claude mcp add moneyflow -- uv run --directory /path/to/moneyflow python -m moneyflow mcp --db postgresql://mf_reader:<MF_READER_PASSWORD>@localhost:5434/moneyflow_devEverything after -- is the server command. Use -s user or -s project before the name to change the scope (default local).
Tests and quality gates
uv run pytest -q
./check.shCI runs the same gates as ./check.sh fast and ./check.sh mutation, in two parallel jobs. It covers tests, import contracts, CRAP, duplication and mutation testing. To set up the test database, see AGENTS.md.
Contributing
See CONTRIBUTING.md. Releases are automatic: semantic-release reads conventional commits on main and publishes a GitHub release and CHANGELOG.md.
Security
See SECURITY.md.
License
Available Tools
4 toolscategory_totalsA
Signed kept amount per (category, subcategory, currency), either over [date_from, date_to] (both inclusive) or over one budget month (YYYY-MM), not both.
Inputs: date_to, date_from, budget_month. Returns: result
find_transactionsC
Transactions with their ledger entry. text is a case-insensitive substring of description or comment.
Inputs: date_to (required), date_from (required), text, limit, +1 more. Returns: result
month_summaryA
One budget cycle: dates, days total and left, income and total actual per currency (original-currency amounts, never folded into one number) and cash in hand (null before the cash cutover). budget_month (YYYY-MM) defaults to the open cycle.
Inputs: budget_month. Returns: object
spendingB
Signed kept amount per currency for one category over [date_from, date_to], both inclusive.
Inputs: date_to (required), category (required), date_from (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
spending and category_totals both aggregate signed amounts over date ranges and could be confused, but spending is scoped to one category while category_totals provides a multi-category breakdown. month_summary and find_transactions are clearly distinct from both.
find_transactions follows a verb_noun pattern, while spending, category_totals, and month_summary are noun-based. The names are readable, but the convention is mixed rather than predictable.
Four tools is a focused, well-scoped set for a reporting-oriented server, and each tool covers a distinct query need. There is no excessive surface area or obviously redundant tool.
The read-only reporting surface covers spending, category breakdowns, monthly summaries, and transaction search, but lacks transaction creation/editing, category/account listing, and budget management. These are notable gaps if the server is meant to support full budget workflows.
Maintenance
Related MCP Connectors
Query your real net worth, spending, transactions, budgets and portfolio from any MCP client.
Query, edit, and reconcile a hosted Beancount ledger: BQL, reports, files, and bank imports.
Managed Postgres MCP: projects, SQL, docs search, and storage buckets via OAuth.
Personal net-worth tracker MCP: query assets and P&L; scoped write tools with a per-call audit log.
Related MCP Servers
- AlicenseAqualityCmaintenanceLocal MCP server for safe querying and inspecting PostgreSQL databases, with write and maintenance operations disabled by default.81MIT
- AlicenseNot gradedqualityDmaintenanceProvides a read-only PostgreSQL MCP server with schema introspection. Enforces least-privilege database roles to prevent any writes, even from malicious SQL.MIT
- FlicenseAqualityBmaintenanceEnables MCP clients to safely inspect and query an explicitly allowlisted subset of a Postgres database through four read-only tools: a readiness check, table listing, column description, and typed row selection with filters, ordering, and paging. It runs over stdio for local clients or Streamable HTTP for separately managed ones, with bound parameters, bounded reads, and read-only transactions.4-
- AlicenseNot gradedqualityBmaintenanceEnables MCP-compatible clients to query a local MoneyWiz SQLite database through a permanently read-only, local-first interface with Decimal-safe per-currency results for accounts, transactions, categories, payees, tags, budgets, scheduled transactions, and cashflow summaries.MIT