YNAB MCP Server

by calebl

Integrations

  • Supports publishing the MCP server as an npm package for easier distribution and installation

  • Used for building tools that interact with YNAB's API through typed interfaces

  • Utilized for schema validation of tool inputs when interacting with YNAB data

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(オプション)

ゴール

このプロジェクトの目標は、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を設定する
    • descriptionauthorlicenseなどを追加します。
    • 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. サーバーは起動時にツールを自動的に読み込みます

もっと詳しく知る

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

YNAB (You Need A Budget) データとの AI を活用したインタラクションを可能にし、ユーザーが会話型インターフェースを通じて予算を照会できるようにするモデル コンテキスト プロトコル サーバー。

  1. 設定
    1. ゴール
      1. ワークフロー:
        1. 初回セットアップ
        2. 支出超過カテゴリーを管理する
        3. 新しい取引を追加する
        4. 取引の承認
        5. 毎月の総支出と総収入を確認する
        6. カテゴリー目標に基づいて資金を割り当てる準備ができた自動配分
      2. 現在の状態
        1. クイックスタート
          1. プロジェクト構造
            1. コンポーネントの追加
              1. ツール開発
                1. npmへの公開
                  1. Claude Desktopでの使用
                    1. Smithery経由でインストール
                    2. 地域開発
                    3. 公開後
                    4. その他のMCPクライアント
                  2. 構築とテスト
                    1. もっと詳しく知る

                      Related MCP Servers

                      • A
                        security
                        F
                        license
                        A
                        quality
                        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.
                        Last updated -
                        10
                        1
                        Python
                      • -
                        security
                        F
                        license
                        -
                        quality
                        Provides access to YNAB (You Need A Budget) functionality through the Model Context Protocol, allowing users to view account balances, access transaction data, and create new transactions.
                        Last updated -
                        Python
                      • -
                        security
                        A
                        license
                        -
                        quality
                        A Model Context Protocol server that enables AI assistants to manage meeting data, including creating meeting bots, searching transcripts, and organizing calendar events.
                        Last updated -
                        12
                        TypeScript
                        MIT License
                        • Apple
                      • -
                        security
                        A
                        license
                        -
                        quality
                        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.
                        Last updated -
                        Python
                        MIT License

                      View all related MCP servers

                      ID: k7h1fcvgs1