Skip to main content
Glama
klauern

MCP YNAB Server

by klauern

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
YNAB_API_KEYYesYour YNAB API key obtained from YNAB Developer Settings (https://app.ynab.com/settings/developer)

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
set_preferred_budget_idA

Set the preferred YNAB budget ID.

pingA

Verify YNAB API auth by fetching the current user's id.

Useful for confirming that ``YNAB_API_KEY`` is set and valid without
touching budget data.
executeA

Execute a Python snippet against the gated ynab.read/ynab.write Code Mode API.

Enabled by default. Mutating calls require ``code_mode_mutations_enabled`` preference
and must use ``ynab.write.*``. The snippet is treated as the body of an async function:
``await ynab.read.get_budgets()``, ``return`` directly.
searchA

Discover available YNAB tools by running a Python snippet against the tool catalog.

The snippet runs in a sandboxed environment with a ``spec`` variable — a list of dicts,
each with keys ``name``, ``namespace`` (``"read"`` or ``"write"``), ``signature``,
``doc``, and ``returns``. Filter or map ``spec`` and return the subset you need.

Example: ``return [t for t in spec if "transaction" in t["name"]]``

No live YNAB API access. Returns the same CodeModeResult shape as execute.
set_api_keyA

Store a YNAB personal access token in the OS keychain.

The token is persisted in the platform keychain (macOS Keychain,
Windows Credential Locker, or Linux Secret Service) under
service=``mcp-ynab`` user=``YNAB_API_KEY``. After this returns, future
requests in this process and future runs will pick the key up via
``_resolve_api_key`` — though the ``YNAB_API_KEY`` env var still wins
if it is set.
clear_api_keyA

Remove the stored YNAB API key from the OS keychain (env var unaffected).

get_preferencesA

Return the current YNAB MCP preferences as a markdown table.

Reads the in-memory ``ynab_resources.preferences`` (which already reflects
the env > preferences.json > defaults source order). The same content is
available as a resource at ``ynab://preferences`` for clients that prefer
to read it that way.
set_preferenceA

Set a single preference and persist it to preferences.json.

``name`` must be one of the ``Preferences`` model fields:
``default_budget_id``, ``category_cache_ttl_minutes``, or
``confirm_before_post``. Bool values accept any of
``1/0/true/false/yes/no/on/off`` (case-insensitive). The empty string is
the documented way to clear ``default_budget_id`` (stored as ``None``);
on a non-Optional field it surfaces as a coercion error.

Note: changes to ``default_budget_id`` here are equivalent to calling
``set_preferred_budget_id``; both write the same field.

Prompts

Interactive templates invoked by user choice

NameDescription
weekly_reviewWalk through the weekly transaction-cleanup workflow.
monthly_budget_checkMid- or end-of-month sanity check: overspending and reallocation.
move_money_interactiveInteractive reallocation between two categories.
fund_sinking_categoriesRule 2: allocate to non-monthly true-expense categories.
categorize_recentBatch-categorize recent transactions for an account or budget.
spending_by_payeeTop-N payee spending report with period-over-period delta.

Resources

Contextual data attached and managed by the client

NameDescription
get_preferred_budget_idGet the preferred YNAB budget ID.
get_preferences_resourceReturn all preferences as a markdown table; mirrors the ``get_preferences`` tool.
get_code_mode_stubsReturn Python type stubs for the current Code Mode namespace.
get_code_mode_examplesReturn curated examples for the Python Code Mode runner.
list_budgets_resourceList all (non-closed/non-deleted) budgets as a markdown table.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/klauern/mcp-ynab'

If you have feedback or need assistance with the MCP directory API, please join our Discord server