YNAB MCP server

Integrates with YNAB's official API to provide read-only access to budget data including accounts, categories, and monthly budget information with automatic currency formatting and pagination support.
Back to servers
Setup instructions
Provider
Chris Guidry
Release date
Jun 12, 2025
Stats
4 stars

This MCP server provides Large Language Models (LLMs) access to your YNAB (You Need A Budget) financial data, allowing them to interact with and analyze your budgets through a structured API.

Installation

Install Dependencies

Use the uv package manager to install the required dependencies:

uv sync

Get YNAB Access Token

To connect the MCP server to your YNAB account:

  1. Log into your YNAB account at https://app.youneedabudget.com
  2. Go to Account Settings (click your email in the top right corner)
  3. Click on Developer Settings in the left sidebar
  4. Click New Token
  5. Enter a token name (e.g., "MCP Server")
  6. Click Generate
  7. Copy the generated token (you won't be able to see it again)

Set Environment Variables

Set your YNAB access token as an environment variable:

export YNAB_ACCESS_TOKEN=your_token_here

Optionally, set a default budget ID to avoid specifying it in every API call:

export YNAB_DEFAULT_BUDGET=your_budget_id_here

Run the Server

Start the MCP server with:

uv run python server.py

Usage

The MCP server provides several tools to access your YNAB data:

Available Tools

  • List Budgets

    list_budgets()
    

    Returns all your YNAB budgets

  • List Accounts

    list_accounts(budget_id=None, limit=100, offset=0, include_closed=False)
    

    Returns accounts with pagination and filtering options

  • List Categories

    list_categories(budget_id=None, limit=50, offset=0, include_hidden=False)
    

    Returns categories with pagination and filtering options

  • List Category Groups

    list_category_groups(budget_id=None)
    

    Returns category groups with totals (a more lightweight overview)

Working with Pagination

For tools that return large datasets, pagination is supported:

  • First page:

    list_categories(limit=50, offset=0)
    
  • Second page:

    list_categories(limit=50, offset=50)
    

You can check if more results are available by examining the pagination.has_more property in the response.

Security Considerations

Keep your YNAB access token secure and never commit it to version control. The token provides read access to all your budget data.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "you-need-an-mcp" '{"command":"python","args":["server.py"],"env":{"YNAB_ACCESS_TOKEN":"${YNAB_ACCESS_TOKEN}","YNAB_DEFAULT_BUDGET":"${YNAB_DEFAULT_BUDGET}"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "you-need-an-mcp": {
            "command": "python",
            "args": [
                "server.py"
            ],
            "env": {
                "YNAB_ACCESS_TOKEN": "${YNAB_ACCESS_TOKEN}",
                "YNAB_DEFAULT_BUDGET": "${YNAB_DEFAULT_BUDGET}"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

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

2. Add this to your configuration file:

{
    "mcpServers": {
        "you-need-an-mcp": {
            "command": "python",
            "args": [
                "server.py"
            ],
            "env": {
                "YNAB_ACCESS_TOKEN": "${YNAB_ACCESS_TOKEN}",
                "YNAB_DEFAULT_BUDGET": "${YNAB_DEFAULT_BUDGET}"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later