YNAB MCP Server
Allows using 1Password CLI reference for token fallback to securely retrieve YNAB API token.
Click on "Install 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., "@YNAB MCP ServerHow much did I spend on groceries this 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.
Why This Exists
YNAB's budgeting philosophy works best when you interact with your budget frequently - but the app interface isn't designed for quick queries or bulk operations. "How much did I spend on groceries this month?" shouldn't require navigating three screens. "Categorize all my Amazon orders from this week" shouldn't be a manual, one-by-one process.
This server gives your AI assistant a safe interface to YNAB's API, turning natural language into budget review and, when explicitly enabled, budget operations. All monetary values are automatically converted between dollars and YNAB's internal milliunits format so the AI never has to think about it. Built on the official YNAB JavaScript SDK with direct API calls for the newest endpoints (category creation, category groups, money movements) that the SDK hasn't caught up with yet.
Quick Start
Install with MCPB
For Claude Desktop and other MCPB-compatible clients, download the local bundle from the v2.0.0 release:
Download ynab-mcp-server-2.0.0.mcpb
The bundle includes the YNAB favicon, production runtime dependencies, and setup prompts for your personal access token, optional default budget ID, and optional write-tool opt-in.
1. Get a YNAB Personal Access Token
Go to YNAB Developer Settings and create a new personal access token.
2. Configure your MCP client
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"ynab": {
"command": "npx",
"args": ["-y", "@oliverames/ynab-mcp-server"],
"env": {
"YNAB_API_TOKEN": "your-token-here"
}
}
}
}Claude Code (.mcp.json):
{
"mcpServers": {
"ynab": {
"command": "npx",
"args": ["-y", "@oliverames/ynab-mcp-server"],
"env": {
"YNAB_API_TOKEN": "your-token-here"
}
}
}
}Or install globally and point to the binary directly:
npm install -g @oliverames/ynab-mcp-server{
"mcpServers": {
"ynab": {
"command": "ynab-mcp-server",
"env": {
"YNAB_API_TOKEN": "your-token-here",
"YNAB_BUDGET_ID": "optional-default-budget-id"
}
}
}
}That's it. Your AI can now talk to YNAB.
By default, the server registers read-only tools only. To expose tools that create, update, import, or delete YNAB data, add YNAB_ALLOW_WRITES=1 to the MCP server environment:
{
"mcpServers": {
"ynab": {
"command": "npx",
"args": ["-y", "@oliverames/ynab-mcp-server"],
"env": {
"YNAB_API_TOKEN": "your-token-here",
"YNAB_ALLOW_WRITES": "1"
}
}
}
}What You Can Do
Ask your AI... | What happens under the hood |
"How much did I spend on groceries this month?" |
|
"Show me all unapproved transactions" |
|
"Log a $50 Costco trip under groceries" |
|
"Set up monthly $1,500 rent on the 1st" |
|
"Move $200 from emergency fund to dining" |
|
"Categorize all my Amazon orders from this week" |
|
"Create a 'Side Projects' spending category" |
|
"How has my budget been re-allocated this month?" |
|
"What recurring payments do I have?" |
|
"Import my latest bank transactions" |
|
Features
Complete YNAB API v1.83 coverage with 45 tools when writes are enabled:
Resource | Tools | Capabilities |
Budgets | 4 | List, view details, settings |
Accounts | 3 | List, view, create |
Categories | 9 | Full CRUD, groups, search, goals, monthly budgets |
Payees | 5 | List, view, create, rename, search |
Payee Locations | 3 | GPS coordinates for mobile transactions |
Months | 2 | Monthly summaries with per-category breakdown |
Money Movements | 4 | Budget re-allocation tracking |
Transactions | 8 | Full CRUD, bulk ops, split transactions, multi-filter |
Scheduled Transactions | 5 | Full CRUD for recurring transactions |
Convenience | 2 | Unapproved transaction review and overspending checks |
Design Decisions
Read-only by default - write tools are not registered unless
YNAB_ALLOW_WRITES=1is set. Read tools are annotated withreadOnlyHint: true; write tools are annotated withreadOnlyHint: false, idempotency hints, and destructive hints for delete operations.Dollar amounts everywhere - inputs and outputs are in dollars (
-12.34), never milliunits (-12340). Conversion is automatic and transparent.Smart budget resolution - set
YNAB_BUDGET_IDfor a default, or omit it to auto-resolve to your last-used budget. Every tool accepts an optionalbudgetIdoverride.Pinned YNAB host - all HTTP requests are restricted to
https://api.ynab.com, redirects are not followed, and API tokens are redacted from surfaced errors.Token fallback options - use
YNAB_API_TOKEN, a small token file viaYNAB_API_TOKEN_FILE, or a 1Password CLI reference viaYNAB_OP_PATH.Split transactions - first-class support for subtransactions in create, read, and format operations.
Bulk operations -
create_transactionsandupdate_transactionshandle arrays in a single API call.Verified batch updates -
update_transactionsrefetches every requested transaction after the bulk API call, retries mismatched fields once throughupdate_transaction, and returns averificationblock so approval counts cannot hide failed category writes.Fetch-then-merge updates - scheduled transaction updates (which use PUT semantics) automatically fetch the current state and merge your changes, so you only specify what changed.
Fuzzy search -
search_categoriesandsearch_payeesdo case-insensitive partial matching across all entries.Approval workflow with anomaly flags -
review_unapprovedgroups transactions into "ready to approve" (categorized, split, or transfer) and "needs attention" (uncategorized), and attaches aflagsarray to each transaction surfacing anomalies:manually_entered(not bank-imported),match_broken(stale match reference),scheduled_transaction_realized,new_payee,no_prior_amount_match(novel amount for this payee), andcategory_drift:was_X(payee categorized differently in the prior 60 days). Group-level flags aggregate the union of all transaction flags.Nullable updates - update tools accept
nullfor clearable fields (memo,payeeName,categoryId,flagColor) to distinguish "don't change" (omit) from "clear this field" (null).Target behavior support - category create/update tools expose
goalNeedsWholeAmountfor YNAB's "Set aside another" vs. "Refill up to" goal behavior.Delta request support - high-volume list tools accept
lastKnowledgeOfServerand returnserver_knowledgewhen that parameter is provided.Debt account support - loan and debt accounts include
debt_original_balance,debt_interest_rates,debt_minimum_payments, anddebt_escrow_amountswith correct unit conversion (rates stay as percentages, payments convert from milliunits).
Tools Reference
Read tools are available by default. Tools that create, update, import, or delete YNAB data are marked as write tools and are registered only when YNAB_ALLOW_WRITES=1.
User & Budgets
Tool | Description |
| Get the authenticated user |
| List all budgets with IDs, names, date ranges, format settings, and default budget |
| Get budget summary (name, currency, account/category/payee counts) |
| Get currency and date format settings |
Accounts
Tool | Description |
| List all accounts with balances, debt details, and import status |
| Get full account details including notes and debt fields |
| Write tool: create a new account (checking, savings, creditCard, mortgage, etc.) |
Supported account types: checking, savings, cash, creditCard, lineOfCredit, otherAsset, otherLiability, mortgage, autoLoan, studentLoan, personalLoan, medicalDebt, otherDebt
Categories & Category Groups
Tool | Description |
| List all category groups and their categories with budgeted/activity/balance |
| Get full category details including goal progress and cadence |
| Get category budget for a specific month |
| Write tool: set the budgeted amount for a category in a month |
| Write tool: update name, note, goal target, goal target date, or move to a different group |
| Write tool: create a new category in an existing group (with optional goal) |
| Write tool: create a new category group |
| Write tool: rename a category group |
| Case-insensitive partial name search (e.g., "groc" finds "Groceries") |
Payees
Tool | Description |
| List all payees with transfer account mappings |
| Get payee details |
| Write tool: create a new payee |
| Write tool: rename a payee |
| Case-insensitive partial name search |
Payee Locations
Tool | Description |
| List all payee locations (GPS coordinates from mobile app) |
| Get a specific payee location |
| Get all locations for a specific payee |
Months
Tool | Description |
| List budget months with income, budgeted, activity, to-be-budgeted, age of money, and notes |
| Get month detail with per-category budget/activity/balance/goal breakdown |
Money Movements
Tool | Description |
| List all money movements (budget re-allocations between categories) |
| Get money movements for a specific month |
| List all money movement groups (batched re-allocations) |
| Get money movement groups for a specific month |
Transactions
Tool | Description |
| Get transactions with filters: by account, category, payee, month, or status ( |
| Get a single transaction by ID (includes subtransactions). Auto-handles composite scheduled-transaction IDs like |
| Write tool: create a transaction with optional split (subtransactions must sum to total) |
| Write tool: bulk create multiple transactions in a single API call (supports split transactions) |
| Write tool: partial update - only specified fields change |
| Write tool: batch update multiple transactions at once, then refetch and verify requested fields persisted |
| Write tool: delete a transaction |
| Write tool: trigger import from linked bank accounts |
Scheduled Transactions
Tool | Description |
| List all recurring transactions |
| Get a specific scheduled transaction |
| Write tool: create a recurring transaction with frequency |
| Write tool: update (fetch-then-merge preserves unchanged fields) |
| Write tool: delete a scheduled transaction |
Supported frequencies: never, daily, weekly, everyOtherWeek, twiceAMonth, every4Weeks, monthly, everyOtherMonth, every3Months, every4Months, twiceAYear, yearly, everyOtherYear
Convenience
Tool | Description |
| Get unapproved transactions grouped by readiness: "ready to approve" (categorized, split, or transfer) vs. "needs category first" (uncategorized). Each transaction includes a |
| Get categories with negative balances for a month, useful for finding prior-month overspending that reduces the current month's Ready to Assign. |
Workflow Safety Notes
Write Tool Opt-In
The server starts in read-only mode. Write tools are not merely discouraged; they are absent from listTools unless YNAB_ALLOW_WRITES=1 is present when the MCP process starts. This mirrors the safer hosted-connector pattern: the default permission set can inspect budgets, transactions, categories, payees, months, and scheduled transactions, but it cannot mutate financial data.
If a client already has the process running, changing the environment is not enough. Restart the MCP server after setting or clearing YNAB_ALLOW_WRITES.
Batch Updates
When a batch operation categorizes and approves transactions at the same time, do not use review_unapproved counts as the only success check. Approved transactions leave the review queue even if a category write failed, so queue counts can hide approved-but-still-uncategorized transactions.
update_transactions now protects this path by refetching every requested transaction after the bulk API call and comparing the persisted fields with the requested fields. If anything differs, it retries that transaction once through update_transaction. The response includes:
{
"verification": {
"checked": 1,
"retried": [],
"failed": []
}
}Treat any failed entry as a real write failure and inspect the named transaction with get_transaction.
Credit Card Payment Transfers
If two unapproved transactions are clearly a credit card payment plus the matching checking-account outflow, convert them into a transfer before approval. Approving both sides as ordinary categorized transactions preserves the wrong structure and creates cleanup work.
Manual YNAB transfer fixes can replace one side of the pair with a new transaction ID. Read-only verification should not assume both original IDs survive. If one old ID returns resource_not_found, inspect recent activity in both involved accounts and verify the pair by transfer_transaction_id cross-links.
Environment Variables
Variable | Required | Description |
| Yes* | Personal access token from YNAB Developer Settings. |
| No | Path to a file containing the token. The file must be 4 KB or smaller. Used only when |
| No | Default budget ID. If omitted, uses |
| No | Set to |
| No | 1Password secret reference for your API token (see below). Required only if using the 1Password fallback instead of |
| No | Client-side rate limiter. Defaults to |
| No | Maximum burst size before rate limiting pauses requests. Defaults to |
| No | Per-request timeout. Defaults to |
| No | Maximum direct-fetch response size for newer endpoints. Defaults to |
*YNAB_API_TOKEN is required unless YNAB_API_TOKEN_FILE or YNAB_OP_PATH is set.
1Password Integration
If you store your YNAB token in 1Password CLI, set YNAB_OP_PATH to your secret reference and omit YNAB_API_TOKEN:
{
"mcpServers": {
"ynab": {
"command": "npx",
"args": ["-y", "@oliverames/ynab-mcp-server"],
"env": {
"YNAB_OP_PATH": "op://Personal/YNAB API Token/credential"
}
}
}
}The fallback adds ~1-2s to startup and is silently skipped if op is unavailable or the item is not found.
Amount Handling
All amounts in tool inputs and outputs are in dollars (e.g., -12.34 for a $12.34 outflow). The server converts to/from YNAB's internal milliunits format automatically.
Direction | Sign | Example |
Outflow (spending) | Negative |
|
Inflow (income) | Positive |
|
Transfer out | Negative |
|
Transfer in | Positive |
|
Rate Limiting
The YNAB API allows 200 requests per hour per access token, enforced on a rolling window. This server applies a client-side limiter at 190 requests per hour with a burst of 10 by default. Each tool call typically uses one API request, except tools that deliberately verify or merge writes (update_transactions, update_scheduled_transaction) which perform additional reads.
Set YNAB_RATE_LIMIT_PER_HOUR=0 only for controlled local tests or smoke checks where you know you will stay under YNAB's API limit.
Architecture
┌─────────────────────┐ ┌──────────────────┐ ┌──────────────┐
│ AI Assistant │────▶│ YNAB MCP Server │────▶│ YNAB API │
│ (Claude, GPT, etc) │◀────│ (this package) │◀────│ api.ynab.com│
└─────────────────────┘ └──────────────────┘ └──────────────┘
MCP stdio transport HTTPS/RESTTransport: stdio (standard MCP server pattern)
Auth: Bearer token via
YNAB_API_TOKEN,YNAB_API_TOKEN_FILE, orYNAB_OP_PATHSDK: Official
ynabv2.5+ for core endpoints, directfetchfor newer API featuresSafety: read-only default, explicit write opt-in, host-pinned HTTPS requests to
api.ynab.com, no redirect following, redacted token errorsValidation: All parameters validated with Zod schemas
Error handling: API errors are caught, formatted, and returned as MCP error responses with detail messages
For a hosted OAuth connector design, see docs/hosted-oauth-connector.md.
Testing
The integration test suite runs against a live YNAB budget. Most write tests create temporary transactions and delete or restore them, but category and category group creation is not reversible through the public API and is skipped unless explicitly enabled.
YNAB_API_TOKEN=your-token YNAB_BUDGET_ID=your-budget-id npm testUse YNAB_TEST_BUDGET_ID to target a dedicated test budget without changing your server default. To include category and category group creation coverage, run with YNAB_RUN_NONREVERSIBLE_TESTS=1.
Tests cover all tool categories: reads, reversible writes, bulk operations, search, split transactions, scheduled transaction CRUD with fetch-then-merge verification, money movements, and payee locations.
MCP Smoke Tests
Use the smoke tests when you need to prove the server is reachable over stdio without reconstructing a custom MCP client. These commands use the official MCP SDK client, the same transport shape used by normal MCP hosts, and require YNAB_API_TOKEN because this server validates credentials at startup.
YNAB_API_TOKEN=your-token YNAB_BUDGET_ID=your-budget-id npm run smoke:list-tools
YNAB_API_TOKEN=your-token YNAB_BUDGET_ID=your-budget-id npm run smoke:review-unapproved
YNAB_API_TOKEN=your-token YNAB_BUDGET_ID=your-budget-id YNAB_ALLOW_WRITES=1 npm run smoke:batch-verifyTo test the package currently published to npm instead of the local checkout:
YNAB_API_TOKEN=your-token YNAB_BUDGET_ID=your-budget-id npm run smoke:list-tools -- --published
YNAB_API_TOKEN=your-token YNAB_BUDGET_ID=your-budget-id npm run smoke:review-unapproved -- --published
YNAB_API_TOKEN=your-token YNAB_BUDGET_ID=your-budget-id YNAB_ALLOW_WRITES=1 npm run smoke:batch-verify -- --publishedsmoke:list-tools verifies that high-value read tools such as review_unapproved, get_transactions, search_categories, and search_payees are present. When YNAB_ALLOW_WRITES=1 is set, it also verifies update_transactions. smoke:review-unapproved calls review_unapproved with summary: true and prints only aggregate counts. smoke:batch-verify creates a temporary transaction, uses update_transactions to categorize and approve it in one call, refetches it through the MCP server, and deletes it afterward.
Development
git clone https://github.com/oliverames/ynab-mcp-server.git
cd ynab-mcp-server
npm install
YNAB_API_TOKEN=your-token npm startDependencies
@modelcontextprotocol/sdk- MCP server frameworkynab- Official YNAB JavaScript client
Zero additional dependencies. No build step. Pure ESM.
Release Checks
Before publishing, run:
npm run release:check
npm run build:mcpb
npm pack --dry-runAfter publishing, run npm run release:check:registry to verify the npm latest dist-tag, repo metadata, README release links, and MCPB artifact references all agree on the same version.
License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/oliverames/ynab-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server