New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

ynab-mcp

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ynab-mcp

MCP server providing comprehensive YNAB API coverage for Claude integration

latest
Source
npmnpm
Version
0.3.3
Version published
Maintainers
1
Created
Source

YNAB MCP Server

npm version Docker License: MIT Node.js 20+ MCP Compatible TypeScript

A comprehensive Model Context Protocol (MCP) server for YNAB (You Need A Budget) that enables AI assistants like Claude Desktop to read your budget, analyze spending patterns, detect subscriptions, and provide personalized financial insights—all through natural conversation.

Why YNAB MCP?

Traditional YNAB integrations require manual API calls or custom scripting. This MCP server lets you:

  • Talk to your budget naturally — Ask Claude "Am I overspending on dining out?" and get instant insights
  • Get AI-powered financial analysis — Subscription detection, spending trends, savings recommendations, and budget health scores
  • Stay safe by default — Read-only mode protects against accidental changes
  • Access everything — 66 tools total: comprehensive YNAB API coverage (40 tools), 23 custom analytics tools, and 3 system tools

Features

FeatureDescription
Broad API Coverage66 MCP tools spanning the YNAB API endpoints
Advanced Analytics23 tools for spending analysis, trend detection, and financial insights
Read-Only by DefaultWrite operations require explicit opt-in (YNAB_READ_ONLY=false)
Smart Rate LimitingToken bucket algorithm with 180 req/hour budget (10% safety margin)
Intelligent CachingReduces API calls for infrequently changing data
Type-SafeFull TypeScript implementation with Zod schema validation

Quick Start

Prerequisites

  • A YNAB account with API access
  • A YNAB Personal Access Token (get one here)

Installation Options

Option 1: npx (Easiest)

No installation required—run directly:

npx ynab-mcp

Option 2: Docker

docker run -e YNAB_ACCESS_TOKEN=your_token ghcr.io/auzroz/ynab-mcp:latest

Option 3: Install from Source

# Clone the repository
git clone https://github.com/auzroz/ynab-mcp.git
cd ynab-mcp

# Install dependencies and build
npm install
npm run build

# Run the server
npm start

Configuration

The server is configured via environment variables:

VariableRequiredDescription
YNAB_ACCESS_TOKENYesYour YNAB Personal Access Token
YNAB_BUDGET_IDNoDefault budget UUID (uses "last-used" if not set)
YNAB_READ_ONLYNoSet to false to enable write operations (default: true)

Remote / HTTP mode

By default the server speaks stdio (local). Set MCP_TRANSPORT=http to run it as a remote server over the MCP Streamable HTTP transport at POST /mcp, with a plain GET /health for load balancers. Each session gets an isolated client/cache/rate-limiter/audit-log.

VariableDescription
MCP_TRANSPORTstdio (default) or http
PORTHTTP port (default 3000)
ALLOWED_HOSTS / ALLOWED_ORIGINSComma-separated allowlists for DNS-rebinding protection
ENABLE_DNS_REBINDING_PROTECTIONEnable Origin/Host checks (needs an allowlist)

Multi-user (YNAB OAuth). Configure a YNAB OAuth app + ENCRYPTION_KEY + PUBLIC_URL and the server becomes an OAuth 2.1 Authorization Server federated to YNAB: many users connect their own YNAB accounts to one instance, each isolated, choosing read-only or read-write at consent. See docs/REMOTE_HOSTING.md for the full deployer guide (registering the YNAB app, storage, TLS).

Single-user (header auth). If the OAuth variables aren't all set, HTTP mode takes the YNAB token per request via the X-YNAB-Token header (falling back to YNAB_ACCESS_TOKEN for one user). Serve behind TLS.

MCP_TRANSPORT=http PORT=3000 YNAB_ACCESS_TOKEN=… npm start
# connect an MCP client via the mcp-remote shim:
npx mcp-remote http://localhost:3000/mcp --header "X-YNAB-Token: <your-token>"

Claude Desktop Integration

Add to your Claude Desktop configuration:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "ynab": {
      "command": "npx",
      "args": ["ynab-mcp"],
      "env": {
        "YNAB_ACCESS_TOKEN": "your_token_here"
      }
    }
  }
}

Using Docker

{
  "mcpServers": {
    "ynab": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "YNAB_ACCESS_TOKEN",
        "ghcr.io/auzroz/ynab-mcp:latest"
      ],
      "env": {
        "YNAB_ACCESS_TOKEN": "your_token_here"
      }
    }
  }
}

Using Local Build

{
  "mcpServers": {
    "ynab": {
      "command": "node",
      "args": ["/path/to/ynab-mcp/dist/index.js"],
      "env": {
        "YNAB_ACCESS_TOKEN": "your_token_here"
      }
    }
  }
}

Example Conversations

Once connected, try asking Claude:

QuestionTool Used
"What's my current net worth?"ynab_net_worth
"How much did I spend on dining out this month?"ynab_list_category_transactions
"What subscriptions do I have?"ynab_detect_recurring
"Is my budget in good shape?"ynab_budget_health
"Where can I cut back on spending?"ynab_savings_opportunities
"Am I on track this month?"ynab_spending_pace
"Compare this month to last month"ynab_monthly_comparison

Available Tools (66 Total)

Analytics Tools (23)

These tools provide AI-powered financial insights beyond basic YNAB functionality:

ToolDescription
ynab_detect_recurringFind subscription patterns and recurring payments
ynab_spending_analysisAnalyze spending trends by category
ynab_budget_healthAssess overall budget health with score and alerts
ynab_savings_opportunitiesIdentify potential areas to save money
ynab_budget_vs_actualsCompare budgeted vs actual spending
ynab_quick_summaryAt-a-glance budget status overview
ynab_income_expenseIncome vs expense breakdown and trends
ynab_net_worthCalculate total net worth from all accounts
ynab_goal_progressTrack goal funding progress with projections
ynab_spending_by_payeeAnalyze spending by merchant/payee
ynab_unused_categoriesFind inactive or unused categories
ynab_monthly_comparisonMonth-over-month spending comparison
ynab_spending_trendsMulti-month trend analysis with projections
ynab_cash_flow_forecastProject future cash flow based on scheduled transactions
ynab_reconciliation_helperHelp with account reconciliation
ynab_budget_suggestionsGet budget suggestions based on history
ynab_overspending_alertsQuick check for overspent categories
ynab_transaction_searchPowerful multi-filter transaction search
ynab_spending_paceTrack daily spending rate vs target
ynab_category_balancesQuick category balance lookup
ynab_credit_card_statusCredit card balances vs payment categories
ynab_age_of_moneyAge of money metric with explanation
ynab_preview_scheduled_transactionPreview the budget impact of a scheduled transaction

Core YNAB API Tools (40)

Coverage of the YNAB API endpoints:

User Tools (1)
  • ynab_get_user — Get authenticated user information
Budget Tools (3)
  • ynab_list_budgets — List all accessible budgets
  • ynab_get_budget — Get detailed budget information
  • ynab_get_budget_settings — Get budget settings (currency format, etc.)
Account Tools (3)
  • ynab_list_accounts — List all accounts with balances
  • ynab_get_account — Get specific account details
  • ynab_create_account — Create a new account (write mode)
Category Tools (7)
  • ynab_list_categories — List all category groups and categories
  • ynab_get_category — Get category details
  • ynab_get_month_category — Get category budget for specific month
  • ynab_update_category — Update category budgeted amount (write mode)
  • ynab_create_category — Create a new category in a group (write mode)
  • ynab_create_category_group — Create a new category group (write mode)
  • ynab_update_category_group — Rename a category group (write mode)
Payee Tools (7)
  • ynab_list_payees — List all payees (merchants/vendors)
  • ynab_get_payee — Get specific payee details
  • ynab_create_payee — Create a new payee (write mode)
  • ynab_update_payee — Rename a payee (write mode)
  • ynab_list_payee_locations — List all payee locations for mapping
  • ynab_get_payee_location — Get specific payee location
  • ynab_list_payee_locations_by_payee — List locations for a specific payee
Month Tools (2)
  • ynab_list_months — List all budget months
  • ynab_get_month — Get detailed month summary with categories
Transaction Tools (11)
  • ynab_list_transactions — List transactions with filters
  • ynab_get_transaction — Get transaction details
  • ynab_create_transaction — Create a new transaction (write mode)
  • ynab_create_transactions — Bulk create transactions (write mode)
  • ynab_update_transaction — Update a transaction (write mode)
  • ynab_update_transactions — Bulk update transactions (write mode)
  • ynab_delete_transaction — Delete a transaction (write mode)
  • ynab_list_account_transactions — List transactions for a specific account
  • ynab_list_category_transactions — List transactions for a specific category
  • ynab_list_payee_transactions — List transactions for a specific payee
  • ynab_import_transactions — Trigger import from linked banks (write mode)
Scheduled Transaction Tools (5)
  • ynab_list_scheduled_transactions — List scheduled/recurring transactions
  • ynab_get_scheduled_transaction — Get scheduled transaction details
  • ynab_create_scheduled_transaction — Create a scheduled transaction (write mode)
  • ynab_update_scheduled_transaction — Update a scheduled transaction (write mode)
  • ynab_delete_scheduled_transaction — Delete a scheduled transaction (write mode)
Money Movement Tools (1)
  • ynab_list_money_movements — List moves of funds between categories
System Tools (3)
  • ynab_rate_limit_status — Check API rate limit status
  • ynab_audit_log — View write operation audit log
  • ynab_health_check — Test API connectivity

Available Prompts

Beyond raw tool access, the server exposes 7 MCP Prompts — guided workflows grounded in YNAB's own budgeting methodology (the Four Rules, Age of Money, True Expenses) that orchestrate several tools into a single review. Any MCP client that supports the prompts capability can invoke them directly.

PromptWhat it does
ynab-pulse-checkFast daily-style status check
ynab-monthly-reviewFull end-of-month budget review and next month's suggested targets
ynab-assign-moneyGive Every Dollar a Job — allocate unassigned funds
ynab-true-expensesEmbrace Your True Expenses — plan for irregular/annual costs
ynab-overspending-triageRoll With the Punches — find and fix overspending
ynab-age-of-moneyAge Your Money — check cash cushion and credit card float
ynab-reconcile-cleanupWeekly hygiene: reconciliation and category cleanup

See docs/REMOTE_HOSTING.md for details.

Skills

Our MCP server gives Claude access to your YNAB budget. Our skills teach Claude YNAB's own best practices — some work standalone, some get sharper when connected. Together, they turn raw budget data into an actual coach.

The skills/ directory has 15 Claude Agent Skills: 7 that orchestrate this MCP server's tools into guided reviews, and 8 standalone coaching skills (getting started, debt payoff, irregular income, windfalls, emergency funds, and more) that work with or without this server connected. Every GitHub Release attaches them as downloadable zips — see skills/README.md for the full list and install instructions.

Development

# Run with hot reload
npm run dev

# Run tests
npm test

# Run tests in watch mode
npm run test:watch

# Lint code
npm run lint

# Fix lint issues
npm run lint:fix

# Type check only
npm run typecheck

Testing with MCP Inspector

npx @modelcontextprotocol/inspector node dist/index.js

Architecture

src/
├── index.ts              # Entry point (selects stdio or http transport)
├── server.ts             # Per-user server + tool registration
├── http.ts               # Express app for remote (Streamable HTTP) mode
├── crypto.ts             # AES-256-GCM at-rest token encryption
├── config/               # Environment configuration
├── auth/                 # Remote OAuth: MCP AS provider, YNAB client, sessions
├── storage/              # Pluggable storage (memory / sqlite / postgres)
├── services/             # Core services
│   ├── ynab-client.ts    # YNAB API wrapper with rate limiting
│   ├── rate-limiter.ts   # Token bucket rate limiter
│   ├── audit-log.ts      # Per-user write audit log
│   └── cache.ts          # In-memory TTL cache
├── tools/                # MCP tool implementations
│   ├── user/
│   ├── budgets/
│   ├── accounts/
│   ├── categories/
│   ├── payees/
│   ├── months/
│   ├── transactions/
│   ├── scheduled-transactions/
│   └── analytics/
└── utils/                # Helpers (currency, dates, errors)

Security

FeatureDescription
Read-Only DefaultWrite operations disabled unless YNAB_READ_ONLY=false
Token SecurityNever commit your YNAB_ACCESS_TOKEN; use environment variables
Input ValidationAll tool parameters validated with Zod schemas
Rate LimitingBuilt-in protection against API quota exhaustion
Audit LoggingAll write operations logged for review

Contributing

  • Fork the repository
  • Create a feature branch (git checkout -b feature/amazing-feature)
  • Make your changes
  • Run tests and linting: npm test && npm run lint
  • Commit your changes (git commit -m 'Add amazing feature')
  • Push to the branch (git push origin feature/amazing-feature)
  • Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Built with ❤️ for the YNAB community

Keywords

mcp

FAQs

Package last updated on 03 Jul 2026

Related posts