预算数据协议服务

一个将YNAB(You Need A Budget)预算数据通过MCP(Model Context Protocol)协议暴露给AI助手(如Claude)的服务,用于预算管理和财务数据交互。

  • by JoseAngel1196
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 JoseAngel1196/ynab-mcp

使用说明

ynab mcp

一个MCP(模型上下文协议)服务器,它公开 你需要一个预算 (你需要一个预算)数据到像克劳德这样的人工智能助手。

先决条件

设置

# Install the pinned Node.js version
asdf install

# Install dependencies
npm install

# Configure your YNAB token
cp .env.example .env
# Edit .env and add your YNAB_API_TOKEN

发展

# Run in dev mode (no build step)
npm run dev

# Type check
npm run typecheck

# Build
npm run build

# Run the built server
npm start

MCP检验员测试

这 MCP检查员 允许您在浏览器UI中交互式调用工具:

# Dev mode (no build needed)
YNAB_API_TOKEN=your_token npx @modelcontextprotocol/inspector tsx src/index.ts

# Or from built output
npm run build
YNAB_API_TOKEN=your_token npx @modelcontextprotocol/inspector node dist/index.js

Claude桌面配置

添加 ~/Library/Application Support/Claude/claude_desktop_config.json:

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

可用工具

工具 说明
get_budgets 列出所有预算
get_budget 获取详细的预算信息(账户、类别、收款人)
get_accounts 列出预算中的所有账户
get_categories 列出所有类别组和类别
get_transactions 列出具有可选日期/类型筛选器的交易
create_transaction 创建新交易
update_transaction 更新现有交易
get_payees 列出所有收款人
get_months 列出所有预算月份
get_month_by_id 获得一个月的类别级详细信息

金额说明

YNAB使用 百万单位 对于所有金额: 1 USD = 1000 milliunits在创建或更新交易时,对流出(支出)使用负值,对流入(收入)使用正值。例如,25.50美元的购买是 -25500.

许可证

麻省理工学院