Skip to main content
Glama
YNAB MCP Server

YNAB MCP Server

by calebl

ynab-mcp-server

鍛冶屋のバッジ

mcp-frameworkで構築されたモデルコンテキストプロトコル(MCP)サーバー。このMCPは、 https://ynab.comにあるYNAB予算設定を操作するためのツールを提供します。

AIがこのツールと連携するには、YNABから個人アクセストークンを取得する必要があります: https://api.ynab.com/#personal-access-tokens 。このMCPサーバーをクライアントに追加する際は、個人アクセストークンをYNAB_API_TOKENとして提供する必要があります。このトークンはLLMに直接送信されることはありません。YNAB APIで使用するために、環境変数に非公開で保存されます。

設定

環境変数を指定します:

  • YNAB_API_TOKEN(必須)

  • YNAB_BUDGET_ID(オプション)

Related MCP server: ynab-mcp

ゴール

このプロジェクトの目標は、AIとの会話を通じてYNABの予算管理ツールとやり取りできるようにすることです。実現したい主なワークフローは以下のとおりです。

ワークフロー:

初回セットアップ

  • 利用可能な予算の中から予算を選択するよう求められます。最初に別のツールを使用しようとすると、デフォルトの予算を設定するよう求めるプロンプトが表示されます。

    • 必要なツール: ListBudgets

支出超過カテゴリーを管理する

新しい取引を追加する

取引の承認

毎月の総支出と総収入を確認する

カテゴリー目標に基づいて資金を割り当てる準備ができた自動配分

現在の状態

利用可能なツール:

  • ListBudgets - アカウントで利用可能な予算を一覧表示します

  • BudgetSummary - 資金が不足しているカテゴリと低いアカウントの概要を提供します

  • GetUnapprovedTransactions - 承認されていないすべての取引を取得する

  • CreateTransaction - 指定された予算とアカウントのトランザクションを作成します。

    • 例: Add a transaction to my Ally account for $3.98 I spent at REI today

    • アカウントIDを知るために、まずGetBudgetを呼び出す必要があります

  • ApproveTransaction - YNAB予算内の既存の取引を承認します

    • 承認には取引IDが必要です

    • GetUnapprovedTransactionsと組み合わせて使用することで、保留中の取引を承認することができます。

    • 承認されていない取引を取得した後、プロンプト: approve the transaction for $6.95 on the Apple Card

次:

  • 1回の呼び出しで複数の取引を承認できる

  • updateCategory ツール - または、オプションパラメータを取得して zod および mcp フレームワークで正しく動作させることができれば、より一般的な updateTransaction ツール

  • MCP フレームワークから移行して、モデル コンテキスト プロトコル SDK を直接使用しますか?

クイックスタート

# Install dependencies
npm install

# Build the project
npm run build

プロジェクト構造

ynab-mcp-server/
├── src/
│   ├── tools/        # MCP Tools
│   └── index.ts      # Server entry point
├── .cursor/
│   └── rules/        # Cursor AI rules for code generation
├── package.json
└── tsconfig.json

コンポーネントの追加

YNAB SDK では、利用可能な API エンドポイントについて説明します: https://github.com/ynab/ynab-sdk-js 。

YNABオープンAPI仕様はこちらです: https://api.ynab.com/papi/open\ _api\_spec.yaml 。これを使用して、AIに新しいツールを生成するよう指示することができます。カーソルエージェントのプロンプトの例:

create a new tool based on the readme and this openapi doc: https://api.ynab.com/papi/open_api_spec.yaml

The new tool should get the details for a single budget

CLI を使用してさらにツールを追加できます。

# Add a new tool
mcp add tool my-tool

# Example tools you might create:
mcp add tool data-processor
mcp add tool api-client
mcp add tool file-handler

ツール開発

ツール構造の例:

import { MCPTool } from "mcp-framework";
import { z } from "zod";

interface MyToolInput {
  message: string;
}

class MyTool extends MCPTool<MyToolInput> {
  name = "my_tool";
  description = "Describes what your tool does";

  schema = {
    message: {
      type: z.string(),
      description: "Description of this input parameter",
    },
  };

  async execute(input: MyToolInput) {
    // Your tool logic here
    return `Processed: ${input.message}`;
  }
}

export default MyTool;

npmへの公開

  1. package.json を更新します。

    • nameが一意であり、npm の命名規則に従っていることを確認してください。

    • 適切なversionを設定する

    • description 、 author 、 licenseなどを追加します。

    • binが正しいエントリファイルを指しているか確認する

  2. ローカルでビルドしてテストします。

    npm run build
    npm link
    ynab-mcp-server  # Test your CLI locally
  3. npm にログインします (必要に応じてアカウントを作成します)。

    npm login
  4. パッケージを公開します:

    npm publish

公開後、ユーザーはそれをクロードデスクトップクライアント(下記参照)に追加したり、npxで実行したりすることができます。

Claude Desktopでの使用

Smithery経由でインストール

Smithery経由で Claude Desktop 用の YNAB Budget Assistant を自動的にインストールするには:

npx -y @smithery/cli install @calebl/ynab-mcp-server --client claude

地域開発

この構成を Claude Desktop 構成ファイルに追加します。

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

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

公開後

この構成を Claude Desktop 構成ファイルに追加します。

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

{
  "mcpServers": {
    "ynab-mcp-server": {
      "command": "npx",
      "args": ["ynab-mcp-server"]
    }
  }
}

その他のMCPクライアント

利用可能な他のクライアントについては、 https://modelcontextprotocol.io/clientsを確認してください。

構築とテスト

  1. ツールに変更を加える

  2. npm run buildを実行してコンパイルする

  3. サーバーは起動時にツールを自動的に読み込みます

もっと詳しく知る

Available Tools

13 tools
ynab_balance_forecastBalance ForecastA
Read-only

Projects the combined balance of your accounts over the next N days (from today in UTC) from scheduled transactions only: the starting balance, the scheduled events, the end-of-day running balance and the lowest point. Income or spending that is not scheduled in YNAB is not in the forecast. Transfers between two included accounts (credit card payments too) net to zero; a transfer to an account outside the forecast counts as money leaving, and one from an account outside it as money arriving. Split schedules are counted leg by leg. Occurrences whose date has passed but that YNAB has not entered yet count on the first day, marked overdue with their scheduled_date and summarised in overdue_schedules. Where YNAB does not give the second date of a twice-a-month schedule, it is approximated as 15 days after the first. Events are capped by limit; the running balance, low point and ending balance always cover every day. For past income versus spending, use ynab_cash_flow; to list the schedules themselves, use ynab_list_scheduled_transactions.

Inputs: days, limit, planId, budgetId, +1 more.

ynab_cash_flowCash FlowA
Read-only

Income versus spending, month by month, so you can see whether you are running a surplus. Uses YNAB's own monthly totals rather than re-adding transactions. For a projected balance, use ynab_balance_forecast.

Inputs: months, planId, budgetId, sinceDate.

ynab_detect_recurringDetect RecurringA
Read-only

Finds recurring outflows (subscriptions, bills, memberships) in transaction history by payee, similar amount and regular spacing, whether or not they are scheduled in YNAB. For the scheduled transactions set up in YNAB, use ynab_list_scheduled_transactions. Gives each one's cadence, typical amount, yearly cost at the latest amount, next expected date, whether it seems to have stopped, and already_scheduled (a scheduled transaction has the same payee name; amounts are not compared). This is a heuristic: check the results before acting on them. Splits are counted through their subtransactions. Transfers are excluded, so loan and mortgage payments (transfers to a loan account) and credit card payments are not reported. Inflows are excluded too, and refunds are not netted against charges. Reads the whole window from YNAB in one request, which is slow for a long sinceDate on a busy plan. Yearly charges need a sinceDate far enough back to show minOccurrences of them.

Inputs: planId, budgetId, sinceDate, minOccurrences, +1 more.

ynab_get_transactionsGet TransactionsA
Read-only

Gets transactions from a plan, optionally between a start and end date and by type (all, uncategorized or unapproved). Filter by at most one of account, category or payee: they cannot be combined, and if several are given only the first in that order is applied. month (a plan month) cannot be combined with any of them. Pass transactionId to get just that one transaction: it overrides every other filter, which are all ignored, and a missing or deleted transaction is an error. To search, add payee or memo text, an amount range or a direction. Any search option (or untilDate) adds inflow, outflow and net totals over every match; the totals include transfers between accounts, such as credit card payments. totalsOnly returns just the totals (e.g. categoryId with a year's dates and totalsOnly). Without categoryId or payeeId, split transactions are matched leg by leg and the totals count only the matching legs. With categoryId or payeeId, rows are matched as YNAB returns them, so a split's parent row in the payee listing counts at its full amount.

Inputs: type, limit, month, planId, +13 more.

ynab_list_accountsList AccountsA
Read-only

Lists all accounts in a plan. Useful for finding account IDs when creating transactions.

Inputs: planId, budgetId, includeClosedAccounts.

ynab_list_categoriesList CategoriesA
Read-only

Lists all categories in a plan, grouped by category group. Useful for finding category IDs when creating transactions or updating budgeted amounts.

Inputs: planId, budgetId.

ynab_list_monthsList MonthsA
Read-only

Lists every plan month since the plan began, with raw summary fields: income, budgeted, activity, Ready to Assign, age of money and the month note. For income-versus-spending questions over recent months, use ynab_cash_flow instead.

Inputs: planId, budgetId.

ynab_list_payeesList PayeesA
Read-only

Lists all payees in a plan. Useful for finding payee IDs when creating transactions.

Inputs: planId, budgetId.

ynab_list_plansList PlansA
Read-only

Lists all available plans from YNAB API

Inputs: no named parameters.

ynab_list_scheduled_transactionsList Scheduled TransactionsA
Read-only

Lists the scheduled transactions set up in YNAB, optionally only those in one account with accountId. Pass scheduledTransactionId to fetch just one (accountId is then ignored). To find recurring charges in transaction history, including ones that are not scheduled, use ynab_detect_recurring. For a projected balance, use ynab_balance_forecast.

Inputs: planId, budgetId, accountId, scheduledTransactionId.

ynab_plan_summaryPlan SummaryA
Read-only

Get a summary of the plan for a specific month highlighting overspent categories that need attention and categories with a positive balance that are doing well. Set budgetVsActuals to also compare assigned with actual spending that month: budgeted, activity, balance, variance (budgeted plus activity; below zero means more was spent than assigned) and percent used for every visible category, with subtotals per category group and overall totals, which leave out Credit Card Payments.

Inputs: month, planId, budgetId, budgetVsActuals.

ynab_spending_by_categorySpending By CategoryA
Read-only

Totals spending per category over a date range, biggest spend first. Splits are counted through their subtransactions, and transfers between your own accounts are excluded. Totals are gross outflows: refunds and other inflows aren't netted, so they can differ from a category's activity in YNAB. With monthly: true, each category also gets a month-by-month series, its mean over full months, and how its last full month compares with the earlier ones.

Inputs: limit, months, planId, monthly, +3 more.

ynab_spending_by_payeeSpending By PayeeA
Read-only

Totals spending per payee over a date range, biggest spend first - where the money actually goes by merchant. Splits are counted through their subtransactions, and transfers between your own accounts are excluded. Totals are gross outflows: refunds and other inflows aren't netted, so they can differ from a category's activity in YNAB. With monthly: true, each payee also gets a month-by-month series, its mean over full months, and how its last full month compares with the earlier ones.

Inputs: limit, months, planId, monthly, +3 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 13 tools

    Disambiguation4/5

    Most tools have clearly distinct domains (transactions, accounts, payees, categories, cash flow, forecast, recurring detection), and the descriptions actively cross-reference alternatives ('for X use Y'), which sharply reduces misselection. The one soft spot is ynab_get_transactions, which is a swiss-army tool whose filters/totalsOnly overlap with ynab_spending_by_category, ynab_spending_by_payee and ynab_cash_flow, so an agent could reach for the wrong one for reporting tasks.

    Naming Consistency5/5

    All tools use a uniform ynab_ snake_case prefix with a predictable verb_noun or noun_phrase form (ynab_list_accounts, ynab_get_transactions, ynab_spending_by_category, ynab_balance_forecast). List-style operations consistently use list_ and analytical operations use descriptive noun phrases, so the convention is readable and stable across the set.

    Tool Count5/5

    Thirteen tools is well within the sweet spot and each one maps to a distinct reporting or lookup concern (plans, accounts, transactions, payees, categories, months, three analytics views, forecast, recurring detection). Nothing feels padded or duplicative in count.

    Completeness3/5

    The surface is strong on read/analytics but appears entirely read-only: there is no tool to create, update or delete a transaction, and no way to assign budgeted amounts, even though ynab_list_categories and ynab_list_accounts explicitly advertise themselves as useful 'when creating transactions or updating budgeted amounts'. That leaves agents with dead ends suggested by the descriptions, though reporting and forecasting coverage is thorough.

    Maintenance

    ActivityActive
    ResponsivenessUsually handled

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      An MCP server that allows users to interact with YNAB data, enabling access to account balances, transactions, and the creation of new transactions through the Model Context Protocol.
      8
      6
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol (MCP) server for interacting with YNAB (You Need A Budget). Provides tools for accessing budget data through MCP-enabled clients like Claude Desktop.
      4
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that enables interaction with You Need A Budget (YNAB) via their API, allowing users to manage budgets, accounts, categories, and transactions through natural language.
      2
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      A Model Context Protocol server for YNAB (You Need A Budget). Enables users to query budgets, accounts, categories, transactions, and more, as well as create, update, and delete transactions and manage scheduled transactions from any MCP client.
      27
      2
      MIT