ZenMoney

io.github.krax1337v1.0.0更新于 Oct 1, 2026

ZenMoney (Дзен-мани) finance for AI agents: transactions, reports, budgets, debts

已验证STDIO仅桌面FinanceProductivity & Workflow

概览

AI 生成的概览

让 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。
安装前请注意
该令牌可完全访问 ZenMoney 账户,应作为机密保管,避免写入共享配置文件。写入工具会新增、修改、删除和恢复交易、分类、账户和预算;可用 ZENMONEY_READ_ONLY 或 dry_run 预览变更。除非关闭缓存,否则财务数据快照会保存在本地磁盘。在 HTTP 模式下,非回环绑定必须设置 MCP_HTTP_TOKEN,持有该令牌者即拥有同样的账户访问权限。

安装

在 SourceWeft 中

  1. 打开 控制台中的 ZenMoney,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

mcp-server-zenmoney

[CI] [npm]

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.

  1. Get a token: open https://zerro.app/token, log in with your ZenMoney account and copy the token shown.
  2. Verify it: ZENMONEY_TOKEN=... npx -y mcp-server-zenmoney --check prints OK: <login>, main currency …, N active accounts, M transactions (exit code 1 with the reason otherwise).
  3. 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

sh
claude mcp add zenmoney -e ZENMONEY_TOKEN=YOUR_TOKEN -- npx -y mcp-server-zenmoney

Claude Desktop / Cursor / most MCP clients

claude_desktop_config.json, ~/.cursor/mcp.json, …:

json
{  "mcpServers": {    "zenmoney": {      "command": "npx",      "args": ["-y", "mcp-server-zenmoney"],      "env": { "ZENMONEY_TOKEN": "YOUR_TOKEN" }    }  }}

omp

User-wide config ~/.omp/agent/mcp.json (or per project .omp/mcp.json), inside mcpServers:

json
"zenmoney": {  "type": "stdio",  "command": "npx",  "args": ["-y", "mcp-server-zenmoney"],  "env": { "ZENMONEY_TOKEN": "${ZENMONEY_TOKEN}" }}

omp expands ${VAR} placeholders, so the token can stay in your shell environment. Then /mcp reload.

Keeping the token out of config files

sh
umask 077 && printf '%s' 'YOUR_TOKEN' > ~/.config/zenmoney-token

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

sh
ZENMONEY_TOKEN=... npx -y mcp-server-zenmoney --http --port 3000
  • MCP endpoint (Streamable HTTP): http://127.0.0.1:3000/mcp; GET /health returns {"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_HOST is refused unless MCP_HTTP_TOKEN is set. When set (on any bind), clients must send Authorization: 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

Variable / flagDefaultMeaning
ZENMONEY_TOKEN—ZenMoney API token from https://zerro.app/token
ZENMONEY_TOKEN_FILE—File containing the token (used when ZENMONEY_TOKEN is empty; ~ expanded)
ZENMONEY_READ_ONLY / --read-onlyfalse1/true/yes/on registers only read tools
ZENMONEY_SYNC_TTL30Seconds before data is re-synced on the next tool call
ZENMONEY_CACHE_DIR$XDG_CACHE_HOME/mcp-server-zenmoney, else ~/.cache/mcp-server-zenmoneySnapshot cache directory
ZENMONEY_CACHEon0/false/no/off keeps data in memory only
ZENMONEY_API_URLhttps://api.zenmoney.ru, fallback https://api.zenmoney.appPin a single API origin
MCP_TRANSPORT / --httpstdiohttp serves Streamable HTTP
MCP_HTTP_HOST / --host127.0.0.1HTTP bind address
MCP_HTTP_PORT / --port3000HTTP port
MCP_HTTP_TOKEN—Bearer token HTTP clients must send; required for non-loopback binds
--check—Sync once with the configured token, print a one-line summary and exit
--help, -h / --version, -v—Print usage / version

CLI flags take precedence over the corresponding environment variables.

Tools

Read tools (always registered, annotated readOnlyHint):

ToolPurpose
get_overviewStart here: today's date, main currency, net worth, account balances, this month's income/expenses, upcoming planned operations, data freshness
list_accountsAccounts with balances (also in main currency), credit limits, bank and flags
list_categoriesCategory tree with kind (expense/income/both) and 12-month usage counts
list_payeesKnown payees ranked by use, with last date and usual category
list_transactionsFiltered, paginated transaction search plus income/expense totals of all matches
summarize_transactionsAggregate by category, parent category, payee, account or day/week/month/year; measure=both for cash flow
get_budgetMonthly budget vs. actual, remaining, % used and still-planned operations per category
list_plannedPlanned / recurring operations still pending in a date range, with expected totals
list_debtsPer-person debt balances (positive = they owe you); optionally a person's debt transactions
suggest_categoryCategory/merchant suggestions for payee names from ZenMoney and your own history
syncPull changes from ZenMoney now; full=true re-downloads everything

Write tools (not registered in read-only mode):

ToolPurpose
create_transactionsRecord up to 50 expenses, incomes, transfers or debt operations; auto-categorizes, warns about duplicates
update_transactionsEdit amount, account, category, payee, comment, date, original amount; transfer destination. Type cannot change
delete_transactionsSoft-delete transactions by id
restore_transactionsBring deleted transactions back (as copies with new ids)
create_categoryCreate a category or subcategory (one nesting level)
update_categoryRename, move, change kind, budget inclusion, mandatory flag, archive
delete_categoryDelete a category, moving its transactions and planned operations to move_to or uncategorizing them
set_budgetsSet exact monthly budgets per category, total or uncategorized; 0 removes
create_accountCreate a cash, card, checking or e-money account
update_accountRename, archive, include/exclude from balance, savings flag, credit limit
adjust_account_balanceMatch a real balance by recording a correction income/expense

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:

PromptArgumentsWhat it does
monthly_reviewmonth (YYYY-MM)Income, spending vs. previous month, budget status, large transactions, upcoming payments, suggestions
categorize_transactionsperiodProposes categories for uncategorized transactions, applies after confirmation (dry run first)
plan_budgetmonth (YYYY-MM)Proposes budgets from the last three months and planned payments, applies with set_budgets after confirmation

Conventions

These are also sent to the agent as server instructions.

  • Amounts are always positive; type gives 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 are YYYY-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_to override 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_transactions follow 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_transactions category replaces the main category and keeps secondary tags; null leaves the transaction uncategorized. Moving a transaction to an account in another currency requires the new amount. Changing only amount of 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_transactions re-creates each transaction under a new id; restoring the same transaction again is a no-op that points at the existing copy.
  • Budgets: set_budgets sets an exact amount (lock on); 0 removes 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 than ZENMONEY_SYNC_TTL seconds is refreshed automatically before a tool runs; sync forces it.
  • The replica is persisted to <cache dir>/snapshot-<hash>.json (directory created 0700, file 0600). 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. Set ZENMONEY_CACHE=off to keep everything in memory.
  • API origin: https://api.zenmoney.ru first; if it rejects the token before any request has succeeded, https://api.zenmoney.app is tried. ZENMONEY_API_URL pins 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's env if the agent host runs in a different zone.
  • Snapshots of tokens you no longer use stay in the cache directory; delete old snapshot-*.json files 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_balance records a correction transaction.
  • Currency conversions in reports use current exchange rates, not historical ones.
  • Zerro's envelope budget rollover is not computed.

Development

sh
git clone https://github.com/krax1337/mcp-server-zenmoney && cd mcp-server-zenmoneynpm install         # also builds dist/npm run typecheck   # tsc --noEmitnpm test            # vitest; offline, against an in-repo fake ZenMoney server in test/node dist/index.js  # run the local build

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 transports
  • src/config.ts — environment variables and CLI flags
  • src/server.ts — MCP server and agent instructions
  • src/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
  1. v1.0.0最新Oct 1, 2026