npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ynab-mcp

v0.1.3

Published

MCP server providing complete YNAB API coverage for Claude integration

Downloads

81

Readme

YNAB MCP Server

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 — 55 tools covering 100% of the YNAB API plus 22 custom analytics tools

Features

| Feature | Description | |---------|-------------| | Complete API Coverage | 55 MCP tools spanning all YNAB API endpoints | | Advanced Analytics | 22 tools for spending analysis, trend detection, and financial insights | | Read-Only by Default | Write operations require explicit opt-in (YNAB_READ_ONLY=false) | | Smart Rate Limiting | Token bucket algorithm with 180 req/hour budget (10% safety margin) | | Intelligent Caching | Reduces API calls for infrequently changing data | | Type-Safe | Full TypeScript implementation with Zod schema validation |

Quick Start

Prerequisites

  • Node.js 20 or later
  • A YNAB account with API access
  • A YNAB Personal Access Token (get one here)

Installation

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

# Install dependencies
npm install

# Copy environment template
cp .env.example .env

# Edit .env and add your YNAB_ACCESS_TOKEN

Configuration

Edit .env with your settings:

# Required: Your YNAB Personal Access Token
YNAB_ACCESS_TOKEN=your_personal_access_token

# Optional: Default budget UUID (uses "last-used" if not set)
YNAB_BUDGET_ID=optional_default_budget_uuid

# Optional: Set to false to enable write operations (default: true)
YNAB_READ_ONLY=true

Build & Run

# Build TypeScript
npm run build

# Run the server
npm start

Claude Desktop Integration

Add to your Claude Desktop configuration:

macOS/Linux: ~/.config/claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "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:

| Question | Tool 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 (55 Total)

Analytics Tools (22)

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

| Tool | Description | |------|-------------| | ynab_detect_recurring | Find subscription patterns and recurring payments | | ynab_spending_analysis | Analyze spending trends by category | | ynab_budget_health | Assess overall budget health with score and alerts | | ynab_savings_opportunities | Identify potential areas to save money | | ynab_budget_vs_actuals | Compare budgeted vs actual spending | | ynab_quick_summary | At-a-glance budget status overview | | ynab_income_expense | Income vs expense breakdown and trends | | ynab_net_worth | Calculate total net worth from all accounts | | ynab_goal_progress | Track goal funding progress with projections | | ynab_spending_by_payee | Analyze spending by merchant/payee | | ynab_unused_categories | Find inactive or unused categories | | ynab_monthly_comparison | Month-over-month spending comparison | | ynab_spending_trends | Multi-month trend analysis with projections | | ynab_cash_flow_forecast | Project future cash flow based on scheduled transactions | | ynab_reconciliation_helper | Help with account reconciliation | | ynab_budget_suggestions | Get budget suggestions based on history | | ynab_overspending_alerts | Quick check for overspent categories | | ynab_transaction_search | Powerful multi-filter transaction search | | ynab_spending_pace | Track daily spending rate vs target | | ynab_category_balances | Quick category balance lookup | | ynab_credit_card_status | Credit card balances vs payment categories | | ynab_age_of_money | Age of money metric with explanation |

Core YNAB API Tools (33)

Complete coverage of all YNAB API endpoints:

  • ynab_get_user — Get authenticated user information
  • ynab_list_budgets — List all accessible budgets
  • ynab_get_budget — Get detailed budget information
  • ynab_get_budget_settings — Get budget settings (currency format, etc.)
  • ynab_list_accounts — List all accounts with balances
  • ynab_get_account — Get specific account details
  • ynab_create_account — Create a new account (write mode)
  • 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_list_payees — List all payees (merchants/vendors)
  • ynab_get_payee — Get specific payee details
  • 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
  • ynab_list_months — List all budget months
  • ynab_get_month — Get detailed month summary with categories
  • 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_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)
  • ynab_list_scheduled_transactions — List scheduled/recurring transactions
  • ynab_get_scheduled_transaction — Get scheduled transaction details
  • ynab_rate_limit_status — Check API rate limit status
  • ynab_audit_log — View write operation audit log
  • ynab_health_check — Test API connectivity

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 (stdio server)
├── server.ts             # Tool registration
├── config/               # Environment configuration
├── services/             # Core services
│   ├── ynab-client.ts    # YNAB API wrapper with rate limiting
│   ├── rate-limiter.ts   # Token bucket rate limiter
│   └── 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

| Feature | Description | |---------|-------------| | Read-Only Default | Write operations disabled unless YNAB_READ_ONLY=false | | Token Security | Never commit your YNAB_ACCESS_TOKEN; use environment variables | | Input Validation | All tool parameters validated with Zod schemas | | Rate Limiting | Built-in protection against API quota exhaustion | | Audit Logging | All write operations logged for review |

Contributing

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

License

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

Acknowledgments

Related Projects