
ZenMoney
io.github.krax1337v1.0.0更新於 Oct 1, 2026
ZenMoney (Дзен-мани) finance for AI agents: transactions, reports, budgets, debts
概覽
讓 AI 助理讀取與編輯 ZenMoney 個人財務資料:帳戶、交易、預算、預定付款與債務。
- 功能
- 使用 OAuth 權杖連線 ZenMoney API v8,並在本機保留一份同步的財務資料庫副本。讀取工具涵蓋總覽與餘額、帳戶、分類、收款對象、可篩選的交易搜尋、依分類或期間彙總、每月預算、預定操作、債務以及分類建議。寫入工具可新增、修改、軟刪除與還原交易,管理分類與帳戶,設定每月預算並調整餘額。三個提示詞(每月回顧、交易分類、預算規劃)用來編排這些工具。
- 適用情境
- 適合在 ZenMoney 記帳的使用者,希望助理以自然語言回答支出、預算與債務問題,或記錄與重新分類交易。唯讀模式適合只想分析、不希望發生寫入的使用者。
- 執行需求
- 透過 npx 以 stdio 在本機執行(需要 Node.js 22 或更新版本),也可選用 HTTP 模式。需要 ZenMoney API 權杖,放在 ZENMONEY_TOKEN 中,或透過 ZENMONEY_TOKEN_FILE 指定權杖檔案。需要連線 ZenMoney API 的網路。選用設定包括 ZENMONEY_READ_ONLY、ZENMONEY_SYNC_TTL、ZENMONEY_CACHE_DIR、ZENMONEY_API_URL 與 MCP_HTTP_TOKEN。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 ZenMoney,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
mcp-server-zenmoney
MCP server for ZenMoney (Дзен-мани). It gives an AI agent access to your accounts and balances, lets it search transactions and build reports, read and set monthly budgets, see planned (recurring) operations and debts, categorize spending, and record or edit transactions with safety rails. It talks to the official ZenMoney API v8 (POST /v8/diff/ sync protocol and POST /v8/suggest/) using an OAuth token, e.g. one issued through Zerro.
Unofficial project, not affiliated with ZenMoney or Zerro. Your token and data stay on your machine.
Quick start
Requirements: Node.js >= 22.
- Get a token: open https://zerro.app/token, log in with your ZenMoney account and copy the token shown.
- Verify it:
ZENMONEY_TOKEN=... npx -y mcp-server-zenmoney --checkprintsOK: <login>, main currency …, N active accounts, M transactions(exit code 1 with the reason otherwise). - Add the server to your agent (below).
Without a token the server still starts; every tool then explains how to configure one.
Connect to an agent (stdio)
Claude Code
Claude Desktop / Cursor / most MCP clients
claude_desktop_config.json, ~/.cursor/mcp.json, …:
omp
User-wide config ~/.omp/agent/mcp.json (or per project .omp/mcp.json), inside mcpServers:
omp expands ${VAR} placeholders, so the token can stay in your shell environment. Then /mcp reload.
Keeping the token out of config files
and use "env": { "ZENMONEY_TOKEN_FILE": "~/.config/zenmoney-token" } instead of ZENMONEY_TOKEN.
Read-only
Add "ZENMONEY_READ_ONLY": "true" to env, or --read-only to args. Write tools are then not registered at all.
HTTP mode
- MCP endpoint (Streamable HTTP):
http://127.0.0.1:3000/mcp;GET /healthreturns{"ok":true}; any other path is 404. - Default bind is
127.0.0.1. Loopback binds (127.0.0.1,localhost,::1) apply Host/Origin validation against DNS rebinding. - Any other
--host/MCP_HTTP_HOSTis refused unlessMCP_HTTP_TOKENis set. When set (on any bind), clients must sendAuthorization: Bearer <MCP_HTTP_TOKEN>, otherwise they get 401. It is a single-user server: whoever has that token has your ZenMoney access, so keep it on a private network.
Configuration
CLI flags take precedence over the corresponding environment variables.
Tools
Read tools (always registered, annotated readOnlyHint):
Write tools (not registered in read-only mode):
Write tools carry MCP annotations: creating tools are non-destructive (destructiveHint: false); editing/deleting tools are destructiveHint: true, so clients that honor hints can ask for confirmation.
create_transactions, update_transactions, delete_transactions, delete_category and set_budgets accept dry_run: true: they resolve everything and return the would-be result (for updates: before/after per transaction) without sending anything to ZenMoney.
Prompts
Clients that support MCP prompts (e.g. as slash commands) get three workflows that only orchestrate the tools above:
Conventions
These are also sent to the agent as server instructions.
- Amounts are always positive;
typegives the direction:expense,income,transfer(between own accounts),debt_out(money given to a person: lending or repaying),debt_in(money received: borrowing or being repaid). - Accounts and categories are referenced by name (case- and emoji-insensitive, unique substrings work),
"Parent / Child"category paths, or ids. Accounts can also be referenced by card last digits (4+). - Currencies are ISO codes (
RUB,USD,KZT, ...). Dates areYYYY-MM-DD. - Query tools accept
period:today,yesterday,this_week,last_week,this_month,last_month,this_quarter,last_quarter,this_year,last_year,last_7_days,last_30_days,last_90_days,last_12_months(weeks start Monday;date_from/date_tooverride either end). - Reports are in the main currency at ZenMoney's current exchange rates and, like ZenMoney, count only in-balance accounts unless asked otherwise. Transfers and debts are excluded from summaries. The totals returned by
list_transactionsfollow the same rules (in-balance, not deleted), even when the listed transactions include off-balance or deleted ones. - A missing expense/income category on new transactions is filled from this payee's history first, then from the ZenMoney suggestion service (only live categories of the right kind). A new transaction matching an existing one (same date, type, account and amount) produces a duplicate warning; it is still recorded.
update_transactionscategoryreplaces the main category and keeps secondary tags;nullleaves the transaction uncategorized. Moving a transaction to an account in another currency requires the newamount. Changing onlyamountof a same-currency transfer updates both sides unless the received amount differed (a fee), which is kept.- Every write syncs with ZenMoney first and runs one at a time, so edits made in the app moments earlier are not overwritten and parallel tool calls cannot clobber each other. References to categories/merchants deleted in the app are dropped from pushed objects instead of failing the whole batch.
- If ZenMoney accepts a write but the answer is lost (timeout), the tool says the change may or may not have been saved; the next call re-syncs, so a retry gets a duplicate warning instead of silently doubling.
- Deletes are soft. ZenMoney cannot undelete in place, so
restore_transactionsre-creates each transaction under a new id; restoring the same transaction again is a no-op that points at the existing copy. - Budgets:
set_budgetssets an exact amount (lock on);0removes the budget. Budgets without the lock (set in the app) also include the month's planned operations, as in ZenMoney. The profile's month start day is honored. Rollover between months is not modelled. - Zerro's hidden
🤖 [Zerro Data]account and the reminders attached to it are ignored everywhere.
Example prompts
- "How did October go? Biggest categories and anything unusual compared to September."
- "Add: Magnum 12 450 KZT today from Kaspi Gold, groceries."
- "Recategorize all Yandex Go rides from last month to Transport / Taxi."
- "Copy this month's budgets to next month, but raise Restaurants to 80 000."
- "Who owes me money, and how much in total?"
- "What payments are scheduled for the next two weeks?"
- "My cash wallet actually has 23 000; fix the balance."
Data, privacy and sync
- The server keeps a local replica of your ZenMoney database synced via
/v8/diff/: a full download on first use, incremental diffs afterwards. Data older thanZENMONEY_SYNC_TTLseconds is refreshed automatically before a tool runs;syncforces it. - The replica is persisted to
<cache dir>/snapshot-<hash>.json(directory created0700, file0600). The filename is a hash of token and API origin; the token itself is never written to disk. The snapshot does contain your financial data. SetZENMONEY_CACHE=offto keep everything in memory. - API origin:
https://api.zenmoney.rufirst; if it rejects the token before any request has succeeded,https://api.zenmoney.appis tried.ZENMONEY_API_URLpins a single origin. - HTTP 401 from ZenMoney means the token is no longer valid: get a fresh one at https://zerro.app/token.
- "Today" and default dates use the process time zone; set
TZ(e.g.TZ=Asia/Almaty) in the server'senvif the agent host runs in a different zone. - Snapshots of tokens you no longer use stay in the cache directory; delete old
snapshot-*.jsonfiles after rotating a token. - Logs go to stderr only.
Limitations
- Planned (recurring) operations can be read but not created or edited.
- Loan and deposit accounts cannot be created; bank-synced accounts are created by ZenMoney itself.
- Balances are not edited directly;
adjust_account_balancerecords a correction transaction. - Currency conversions in reports use current exchange rates, not historical ones.
- Zerro's envelope budget rollover is not computed.
Development
Releases: bump version in package.json and server.json, then push a vX.Y.Z tag. The Publish workflow tests, publishes to npm via Trusted Publishing (no token, with provenance) and to the MCP Registry as io.github.krax1337/mcp-server-zenmoney.
Source layout:
src/index.ts— entry point, stdio and HTTP transportssrc/config.ts— environment variables and CLI flagssrc/server.ts— MCP server and agent instructionssrc/prompts.ts— MCP prompts (monthly_review,categorize_transactions,plan_budget)src/tools/— MCP tools (read.ts,write.ts, shared schemas and context)src/zenmoney/— API client (api.ts), sync store and cache (store.ts), ledger semantics (ledger.ts), analytics (analytics.ts), write builders (writes.ts), dates and types
License
MIT
來源:README.md,提交 d0842df
工具
0版本歷史
1- v1.0.0最新Oct 1, 2026


