The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Monarchmoney listing page.
Node.js/TypeScript library for accessing Monarch Money data.
Disclaimer: This project is unofficial and not affiliated with Monarch Money.
Requires Node.js 18+ (uses native fetch and AbortSignal.timeout).
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.
The MFA secret is the "Two-factor text code" from Settings > Security > Enable MFA in Monarch Money.
After a successful login (including email OTP), you can save the token to avoid re-authenticating on every run:
All methods return typed responses. Hover over any method in your editor for full JSDoc and type information.
| Method | Returns | Description |
|---|---|---|
getAccounts() | GetAccountsResponse | All linked accounts |
getAccountTypeOptions() | GetAccountTypeOptionsResponse | Available account types/subtypes |
getRecentAccountBalances(startDate?) | GetRecentAccountBalancesResponse | Daily balances (default: last 31 days) |
getAccountSnapshotsByType(startDate, timeframe) | GetSnapshotsByAccountTypeResponse | Snapshots by type ("year" / "month") |
getAggregateSnapshots(options?) | GetAggregateSnapshotsResponse | Aggregate net value over time |
getAccountHoldings(accountId) | GetAccountHoldingsResponse | Securities in a brokerage account |
getAccountHistory(accountId) | AccountHistorySnapshot[] | Daily balance history |
getInstitutions() | GetInstitutionsResponse | Linked institutions |
getBudgets(startDate?, endDate?) | GetBudgetsResponse | Budgets with actuals (default: last month → next month) |
getSubscriptionDetails() | GetSubscriptionDetailsResponse | Plan status (trial, premium, etc.) |
getTransactionsSummary() | GetTransactionsSummaryResponse | Aggregate summary |
getTransactions(options?) | GetTransactionsResponse | Transactions with full filtering |
getAllTransactions(options?) | Transaction[] | All matching transactions (auto-paginates) |
getTransactionPages(options?) | AsyncGenerator<Transaction[]> | Async generator yielding pages |
getTransactionCategories() | GetTransactionCategoriesResponse | All categories |
getTransactionCategoryGroups() | GetTransactionCategoryGroupsResponse | Category groups |
getTransactionDetails(id) | typed response | Single transaction detail |
getTransactionSplits(id) | typed response | Splits for a transaction |
getTransactionTags() | GetTransactionTagsResponse | All tags |
getCashflow(options?) | GetCashflowResponse | Cashflow by category, group, merchant |
getCashflowSummary(options?) | GetCashflowSummaryResponse | Income, expense, savings, savings rate |
getRecurringTransactions(start?, end?) | GetRecurringTransactionsResponse | Upcoming recurring transactions |
isAccountsRefreshComplete(ids?) | boolean | Check refresh status |
| Method | Returns | Description |
|---|---|---|
createManualAccount(params) | CreateManualAccountResponse | Create manual account |
updateAccount(id, updates) | UpdateAccountResponse | Update account settings/balance |
deleteAccount(id) | DeleteAccountResponse | Delete account |
requestAccountsRefresh(ids) | boolean | Start refresh (non-blocking) |
requestAccountsRefreshAndWait(opts?) | boolean | Refresh and poll until done |
createTransaction(params) | CreateTransactionResponse | Create transaction |
updateTransaction(id, updates) | UpdateTransactionResponse | Update transaction |
deleteTransaction(id) | boolean | Delete transaction |
updateTransactionSplits(id, splits) | UpdateTransactionSplitResponse | Manage splits |
createTransactionCategory(params) | CreateCategoryResponse | Create category |
deleteTransactionCategory(id, moveTo?) | boolean | Delete category |
deleteTransactionCategories(ids) | (boolean | Error)[] | Bulk delete |
createTransactionTag(name, color) | CreateTransactionTagResponse | Create tag |
setTransactionTags(txId, tagIds) | SetTransactionTagsResponse | Set tags on transaction |
setBudgetAmount(params) | SetBudgetAmountResponse | Set/clear budget |
uploadAccountBalanceHistory(id, csv) | void | Upload balance history CSV |
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.
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.).
Track account refresh progress with the onProgress callback:
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.
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:
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.
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).
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.
There are several unofficial Monarch Money integrations. Here's how @hakimelek/monarchmoney stacks up.
| @hakimelek/monarchmoney | monarch-money-api (pbassham) | monarchmoney (keithah) | monarchmoney (hammem) | |
|---|---|---|---|---|
| Platform | Node.js / TypeScript | Node.js / JavaScript | Node.js / TypeScript | Python |
| npm weekly downloads | — | ~440 | ~130 | N/A (pip: ~103K/mo) |
| Runtime deps | 1 (speakeasy) | 5 | 7 | 3 |
| TypeScript types | Full (every response) | None | Yes | N/A |
| Email OTP flow | Yes | No | No | No |
| MFA / TOTP | Yes | Yes | Yes | Yes |
| Session persistence | Yes (0o600 perms) | Yes | Yes (AES-256) | Yes |
| Interactive CLI login | Yes | Yes | Yes | Yes |
| HTTP client | Native fetch | node-fetch | node-fetch + graphql-request | aiohttp |
| Error hierarchy | 4 typed exceptions | Generic throws | Generic throws | 1 exception |
| Read methods | 20 | 15 | ~20 | ~16 |
| Write methods | 14 | 9 | ~12 | ~10 |
| Rate limiting | Yes | No | Yes | No |
| Retry with backoff | Yes | No | Yes | No |
| Auto-pagination | Yes | No | No | No |
| Dual CJS + ESM | Yes | No | Yes | No |
| Refresh progress events | Yes | No | No | No |
| Built-in MCP server | Yes (30 tools) | No | No | No |
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.
Contributions welcome. Please ensure TypeScript compiles cleanly (npm run build) and tests pass (npm test).
MIT