Skip to main content

MCP server for YNAB API

Project description

ynab-mcp

pipeline status coverage report PyPI version Python 3.12+

MCP server exposing YNAB budget data to Claude.

Status

Maintained on a best-effort basis for the YNAB API v1. It is feature-complete for its scope (the tools listed below); there is no roadmap for broader coverage. Bug reports and merge requests are welcome and reviewed as time allows, but timely responses are not guaranteed. Breaking changes are released under a new major version and recorded in CHANGELOG.md. To report a security issue, see SECURITY.md.

Tools

Tool Description
list_budgets List all budgets
list_accounts List accounts for a budget
get_month_summary Current month budgeted vs spent by category group
list_transactions Recent transactions (filterable by account/date)
list_categories Categories with budgeted and activity amounts
list_payees List payees for a budget
get_payee Get a single payee by id
get_spending_by_category Per-category spending for a month (biggest spend first)
create_transaction Add a new transaction (idempotent — identical retries are deduplicated, not duplicated)
set_category_budget Set a category's budgeted amount for a month
update_transaction Edit an existing transaction (only the fields you pass are changed)
delete_transaction Delete a transaction

Requirements

  • Python >= 3.12 (managed by uv/uvx)
  • A YNAB Personal Access Token (YNAB → Settings → Developer Settings)
  • Any OS: the token is read from the YNAB_TOKEN environment variable; on macOS the Keychain is supported as the recommended storage

Setup

1. Provide the YNAB token

Cross-platform (environment variable):

export YNAB_TOKEN="<your-token>"

macOS (Keychain, recommended — no token in shell profiles):

security add-generic-password -s "ynab-mcp" -a "ynab-token" -w "<your-token>"

The env var takes precedence when both are set.

2. Add to Claude Code (~/.claude/settings.json)

Installed from PyPI (recommended):

"mcpServers": {
  "ynab": {
    "type": "stdio",
    "command": "uvx",
    "args": ["rogo-ynab-mcp"]
  }
}

Or from a source checkout: uv sync, then use "command": "uv", "args": ["run", "--project", "/path/to/ynab-mcp", "rogo-ynab-mcp"].

3. Or add to Claude Desktop (claude_desktop_config.json)

Add the server under the top-level mcpServers key (Settings → Developer → Edit Config), then restart Claude Desktop:

{
  "mcpServers": {
    "ynab": {
      "command": "uvx",
      "args": ["rogo-ynab-mcp"]
    }
  }
}

Client compatibility

This is a standard stdio MCP server launched with uvx rogo-ynab-mcp, so any MCP client that supports the stdio transport should work. Only the Claude Code setup is documented and exercised here; the others use the same command and are expected to work but are not separately verified.

Client Status Notes
Claude Code Documented / used Config shown in Setup (~/.claude/settings.json).
Claude Desktop Expected to work Add the same mcpServers block to claude_desktop_config.json.
Cursor Expected to work Register as an MCP server (stdio): command uvx, args ["rogo-ynab-mcp"].
Antigravity Expected to work Register as an MCP server (stdio): command uvx, args ["rogo-ynab-mcp"].
Generic MCP clients Expected to work Any client speaking the MCP stdio transport; point it at uvx rogo-ynab-mcp.

Usage

Once the server is registered, ask your MCP client in natural language — it picks the right tool and fills in the arguments.

What you can ask

  • "Which YNAB budgets can you see?" → list_budgets
  • "How much is in my checking account?" → list_accounts
  • "How am I doing against my budget this month?" → get_month_summary
  • "What did I spend on groceries this month?" → list_categories
  • "Show my transactions since the start of the month." → list_transactions
  • "Which payees do I have?" → list_payees
  • "Add a 12.50 coffee expense to checking, dated today." → create_transaction
  • "Move that coffee transaction to the Dining Out category." → update_transaction

Sample tool output

Amounts are returned as plain numbers in the budget's currency (YNAB milliunits are converted for you). Responses are trimmed to the essential fields to keep the client's context small. Values below are illustrative fakes.

list_transactions:

[
  {
    "id": "b1f2c3d4-5678-49ab-9cde-1234567890ab",
    "date": "2026-07-03",
    "amount": -45.9,
    "payee": "Sample Coffee",
    "category": "Dining Out",
    "account": "Everyday Checking",
    "memo": null,
    "approved": true
  }
]

create_transaction (retries are idempotent — an identical call returns a duplicate marker instead of creating a second transaction):

{
  "duplicate": false,
  "id": "9c3d5e7f-1a2b-4c8d-8e9f-abcdef012345",
  "date": "2026-07-06",
  "amount": -45.9,
  "payee": "Sample Coffee"
}

update_transaction (only the arguments you pass are changed; everything else on the transaction is left as-is):

{
  "id": "9c3d5e7f-1a2b-4c8d-8e9f-abcdef012345",
  "date": "2026-07-06",
  "amount": -45.9,
  "payee": "Sample Coffee",
  "category": "Dining Out",
  "memo": null,
  "approved": true
}

Troubleshooting

Symptom Fix
"YNAB token invalid or expired" (401) Regenerate a Personal Access Token at YNAB → Account Settings → Developer Settings and update YNAB_TOKEN (or the macOS Keychain entry).
"YNAB rate limit reached" (429) The YNAB API allows 200 requests per hour per token. Wait for the window to reset and retry.
Empty results for a month or account Usually not an error: the account may have no transactions in that range, or the since_date/month filter excludes them. Confirm you are using the intended budget and account, and that the month has activity. Closed accounts and hidden categories are omitted by design.

Development

uv run pytest                         # run tests with coverage
uv run pytest --cov-report=html       # HTML coverage report

Disclaimer

Not affiliated with or endorsed by YNAB. YNAB is a trademark of its owner; this project only calls the public YNAB API.

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rogo_ynab_mcp-0.8.0.tar.gz (92.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rogo_ynab_mcp-0.8.0-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file rogo_ynab_mcp-0.8.0.tar.gz.

File metadata

  • Download URL: rogo_ynab_mcp-0.8.0.tar.gz
  • Upload date:
  • Size: 92.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for rogo_ynab_mcp-0.8.0.tar.gz
Algorithm Hash digest
SHA256 093dcb508758f71d90e0e96aa7ce9550f249438d9bea0c680e9f7fa9d8b9fdb8
MD5 bbbfa2a2a75c3eb5606dd8d63a7e4f75
BLAKE2b-256 f746bf1bb09498082d8450da2fa7a129cc648c6c88ecb81922a0c416618059ef

See more details on using hashes here.

File details

Details for the file rogo_ynab_mcp-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: rogo_ynab_mcp-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for rogo_ynab_mcp-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ac08e9b4e6cb440d2248e5efb6be5a63f25b02eb425a06d3b1cc4290123f38e
MD5 52814dd0d81dc3025aa0a13d3ef34716
BLAKE2b-256 37ec91dcdefeed54cd1d97e237ebc24edbb45e8bdf8c2b59f191b6eee18c941c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page