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.
Use the uv
package manager to install the required dependencies:
uv sync
To connect the MCP server to your YNAB account:
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
Start the MCP server with:
uv run python server.py
The MCP server provides several tools to access your YNAB data:
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)
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.
Keep your YNAB access token secure and never commit it to version control. The token provides read access to all your budget data.
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.
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.
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}"
}
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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