
Monarchmoney
io.github.hakimelek由 GitHub 账号 hakimelek 发布v0.3.1更新于 Oct 24, 2026
Monarch Money API client with 30 MCP tools for accounts, transactions, budgets, and cashflow.
概览
非官方的 Monarch Money MCP 服务器,提供 30 个工具,让助手读取和修改个人账户、交易、预算与现金流数据。
- 可以做什么
- 读取账户、机构、余额、快照和券商持仓
- 查询交易、明细、分类、标签、汇总和定期交易
- 查看预算、按分类或商户的现金流以及订阅状态
- 创建、更新或删除交易、账户、分类和标签
- 设置预算金额并触发账户刷新
- 适用场景
- 适合让 AI 助手回答关于自己 Monarch Money 财务数据的问题,或批量修改标签、分类和预算,而无需打开网页应用。
- 运行要求
- 通过 npx 在本地运行,需要 Node.js 18 或更高版本。需要在 MONARCH_TOKEN 环境变量中提供 Monarch Money 认证令牌,该令牌需先用库登录(邮箱、密码以及邮件验证码或 TOTP 多因素认证)并保存获得。需要访问 Monarch API 的网络连接。
安装
在 SourceWeft 中
- 打开 控制台中的 Monarchmoney,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Monarch Money (Node.js)
Node.js/TypeScript library for accessing Monarch Money data.
Disclaimer: This project is unofficial and not affiliated with Monarch Money.
Installation
Requires Node.js 18+ (uses native fetch and AbortSignal.timeout).
Quick Start
Authentication
Monarch's API requires email verification (OTP) for new devices/sessions, even when MFA is disabled. The library handles this with distinct exception types so your app can respond appropriately.
Login with email OTP handling
With MFA secret key (automatic TOTP)
The MFA secret is the "Two-factor text code" from Settings > Security > Enable MFA in Monarch Money.
Session persistence & token reuse
After a successful login (including email OTP), you can save the token to avoid re-authenticating on every run:
Interactive CLI
API
All methods return typed responses. Hover over any method in your editor for full JSDoc and type information.
Read Methods
Write Methods
Error Handling
Configuration
Retry automatically handles transient failures (429 Too Many Requests, 500, 502, 503, 504) with exponential backoff and jitter. The Retry-After header is respected on 429 responses.
Auto-Pagination
getTransactions() returns a single page. For large datasets, use the auto-pagination helpers:
Both methods accept the same filter options as getTransactions() (date range, category, account, tags, etc.).
Refresh Progress
Track account refresh progress with the onProgress callback:
MCP Server (AI Agent Integration)
This package includes a built-in Model Context Protocol server with 30 tools, making your Monarch Money data accessible to AI assistants like Claude Desktop, Cursor, and any MCP-compatible client.
Setup
-
Get your Monarch Money auth token by logging in with the library (see Authentication) and saving
mm.token. -
Add to your MCP client config (e.g. Claude Desktop
claude_desktop_config.json):
Or run it directly:
Available Tools
Read (18 tools): get_accounts, get_account_holdings, get_account_history, get_account_type_options, get_recent_account_balances, get_aggregate_snapshots, get_institutions, get_budgets, get_subscription_details, get_transactions, get_transactions_summary, get_transaction_details, get_transaction_categories, get_transaction_category_groups, get_transaction_tags, get_cashflow, get_cashflow_summary, get_recurring_transactions
Write (12 tools): create_transaction, update_transaction, delete_transaction, create_manual_account, update_account, delete_account, refresh_accounts, is_refresh_complete, set_budget_amount, create_transaction_tag, set_transaction_tags, create_transaction_category
Every tool has typed parameters with descriptions, so AI agents know exactly what arguments to pass.
Project Structure
Testing
Tests use Vitest and do not require real API credentials (fetch is mocked where needed).
Test the API connection (against the live api.monarch.com):
Set these in a .env file for convenience (see .env.example).
FAQ
How do I use this if I login to Monarch via Google?
Set a password on your Monarch account at Settings > Security, then use that password with this library.
Why does Monarch ask for an email code every time I login?
Monarch requires email verification for new/unrecognized devices. After login, save the session token with mm.saveSession() or store mm.token — subsequent runs will reuse it without re-authenticating.
How This Library Compares
There are several unofficial Monarch Money integrations. Here's how @hakimelek/monarchmoney stacks up.
Landscape
Where this library wins
Minimal footprint. One runtime dependency vs 5-7 in the JS/TS alternatives. Native fetch means zero HTTP polyfills on Node 18+.
Email OTP support. Monarch now requires email verification for unrecognized devices, even when MFA is off. This is the only Node.js library that handles the full EmailOtpRequiredException → submitEmailOtp() flow. Without it, automated scripts break on first login from a new environment.
Typed everything. Every API response has a dedicated TypeScript interface — 50+ exported types covering accounts, transactions, holdings, cashflow, budgets, recurring items, and mutations. The monarch-money-api package has no types at all.
Structured error handling. Four distinct exception classes (LoginFailedException, RequireMFAException, EmailOtpRequiredException, RequestFailedException) with error codes and status codes. Competitors throw generic errors or strings.
Broader write coverage. Includes updateTransaction(), setBudgetAmount(), uploadAccountBalanceHistory(), getCashflow(), getCashflowSummary(), and getRecurringTransactions() — all missing from monarch-money-api.
Clean, flat API. One class, direct methods, no sub-objects or verbosity levels to learn. Import MonarchMoney, call methods, get typed results.
Contributing
Contributions welcome. Please ensure TypeScript compiles cleanly (npm run build) and tests pass (npm test).
License
MIT
来源:README.md,提交 fd125b6
工具
0版本历史
1- v0.3.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分