Ynab MCP Server 4f5462c4

MCP数据服务

提供方 arunselvarajdb

数据服务 stdio · 本地进程 Token 社区 / 第三方 Claude DesktopClaude
查看接入方式

YNAB MCP Server是一个只读的预算数据查询服务器,提供预算、账户、交易和类别的查询功能,以及支出分析工具。

一句话选型结论

按资料字段整理

Ynab MCP Server 4f5462c4 属于数据服务类 MCP 服务器,stdio · 本地进程,Token,可直接接入 Claude Desktop、Claude,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类数据服务 传输方式stdio · 本地进程 鉴权Token 部署方式本地部署
GitHub 星标 0 仓库热度,无公开仓库时显示未标注
工具数 6 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

数据服务
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量6暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

预算管理Python本地部署数据分析财务工具API服务只读访问

安装与配置

stdio · 本地进程 Token
客户端在本机拉起子进程,数据不出本机
uv run pre-commit install

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 Python,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后客户端会列出约 6 个工具,随便调一个只读工具确认能返回结果。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
数据库查询

用自然语言查库、取数,不用手写 SQL。

数据同步与清洗

把多来源数据拉到一处做整理。

报表取数

按口径快速拉出统计结果。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 资料标注 6 个工具,职责相对集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude Desktop、Claude,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 使用前要准备好Token对应的凭据,并按最小权限配置。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在数据服务场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop、Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Ynab MCP Server 4f5462c4当前 6 stdio · 本地进程 本地部署 有 2026-05-17
Memory 9d25f64e 9 未标注 未标注 无 2026-05-17
Getzep MCP 9 stdio · 本地进程 本地部署 有 2026-05-17
anything-llm 未标注 stdio · 本地进程 本地部署 有 2026-04-11
Prisma MCP Server 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Astr Bot 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

数据服务
字段来自项目仓库与公开索引,中文说明由本站标注
提供方arunselvarajdb上游标注的维护方 arunselvarajdb
分类数据服务本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式Token远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · Python本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

12.8 KB
来自项目仓库与上游目录的原文,未做删改

YNAB MCP Server

A read-only Model Context Protocol (MCP) server for interacting with YNAB (You Need A Budget) budgets. This server provides tools and resources for querying budgets, accounts, transactions, categories, and generating spending insights.

Features

Core Features

  • Read-Only Access: Safe, non-destructive access to your YNAB data
  • Comprehensive Tools: Get budgets, accounts, transactions, categories, and payees
  • Spending Analysis: Analyze spending patterns with insights and statistics
  • MCP Resources: Formatted budget summaries, account balances, and category spending
  • Secure: API tokens via environment variables, input validation, and error handling
  • Well-Tested: Comprehensive unit tests with >60% code coverage

Development Tools

  • Task Runner: Unified command interface with Taskfile.yml
  • Pre-commit Hooks: Automatic code quality checks on every commit
  • Security Scanning: Code analysis with Bandit, dependency auditing with pip-audit
  • Type Safety: Full type checking with MyPy
  • Code Quality: Linting and formatting with Ruff
  • Secret Detection: Prevent accidental credential commits

Prerequisites

  • Python 3.11 or higher
  • uv package manager
  • YNAB Personal Access Token

Quick Start

1. Install Task Runner (Optional but Recommended)```bash

macOS

brew install go-task

Or visit: https://taskfile.dev/installation/


### 2. Complete Setup

Using Task (recommended):```bash
task setup

Or manually:```bash

Install dependencies

uv sync --all-extras

Copy environment file

cp .env.example .env

Install pre-commit hooks

uv run pre-commit install


### 3. Configure Environment Variables

Edit `.env` and add your YNAB Personal Access Token:```env
# Required: Your YNAB Personal Access Token
YNAB_API_TOKEN=your_token_here

# Optional: Default budget ID
DEFAULT_BUDGET_ID=

# Optional: Log level
LOG_LEVEL=INFO

4. Get Your YNAB API Token

  1. Log in to your YNAB account
  2. Go to Account Settings → Developer Settings
  3. Click New Token under "Personal Access Tokens"
  4. Enter your password to generate the token
  5. Copy the token to your .env file

Security Warning: Never commit your .env file or share your API token!

Usage

Testing with MCP Inspector

Test the server interactively using the MCP Inspector:

Using Task:```bash
task run:inspect


Or directly:```bash
./inspect-server.sh
# or
npx @modelcontextprotocol/inspector uv run ynab-mcp-server

Note: The MCP Inspector is a Node.js tool, so you need Node.js and npm/npx installed.

The inspector provides:
- Interactive tool testing with parameter input
- Real-time response viewing
- Resource browsing
- Request/response logging

Available Task Commands

Run task --list to see all available commands, including:

Setup & Installation:
- task setup - Complete project setup (install deps, create .env, install hooks)
- task install - Install all dependencies including dev tools
- task setup:hooks - Install pre-commit hooks

Code Quality:
- task check - Run all quality checks (format, lint, security, typecheck, test)
- task fmt - Format code with ruff
- task lint - Lint code with ruff
- task typecheck - Type check with mypy

Security:
- task security - Run all security scans
- task security:bandit - Python code security linting
- task security:deps - Dependency vulnerability scanning

Testing:
- task test - Run tests with coverage
- task test:verbose - Run tests with verbose output
- task test:coverage - Generate HTML coverage report

Running:
- task run - Run server in stdio mode
- task run:http - Run server in HTTP mode
- task run:http:debug - Run with debug logging
- task run:inspect - Run MCP Inspector

Pre-commit:
- task pre-commit - Run all pre-commit hooks manually
- task pre-commit:update - Update hooks to latest versions

Running the MCP Server

The server supports two transport modes:

1. stdio Mode (Default)

For use with MCP clients like Claude Desktop or the inspector:

Using Task:```bash
task run


Or directly:```bash
uv run ynab-mcp-server
# or
python -m ynab_mcp_server

2. HTTP/SSE Mode

For HTTP-based access with Server-Sent Events:

Using Task:```bash
task run:http # Run on port 8000
task run:http:debug # Run with debug logging


Or directly:```bash
./run-http-server.sh
# or
uv run ynab-mcp-server --transport sse --port 8000

The HTTP server will be available at http://localhost:8000 (or your chosen port).

Command-line Options:
- --transport {stdio|sse} - Choose transport type (default: stdio)
- --port PORT - HTTP server port (default: 8000, only for SSE)
- --host HOST - HTTP server host (default: localhost, only for SSE)

Available Tools

The MCP server provides the following tools:

get_budgets()

Get list of all budgets for the authenticated user.```json
{
"budgets": [
{
"id": "budget-123",
"name": "My Budget",
"currency_format": {
"iso_code": "USD",
"currency_symbol": "$"
}
}
]
}


#### `get_accounts(budget_id: str)`
Get all accounts for a specific budget.```json
{
  "budget_id": "budget-123",
  "accounts": [
    {
      "id": "account-1",
      "name": "Checking Account",
      "type": "checking",
      "balance": 1500.00,
      "cleared_balance": 1400.00
    }
  ]
}

get_transactions(budget_id: str, since_date?: str, transaction_type?: str, account_id?: str)

Get transactions with optional filters.

Parameters:
- budget_id (required): The budget UUID
- since_date (optional): ISO date (YYYY-MM-DD) to retrieve transactions from
- transaction_type (optional): Filter by type - 'uncategorized' or 'unapproved'
- account_id (optional): Filter by specific account UUID

Examples:```python

Get all transactions

get_transactions("budget-123")

Get transactions since specific date

get_transactions("budget-123", since_date="2025-01-01")

Get unapproved transactions

get_transactions("budget-123", transaction_type="unapproved")

Get transactions for specific account

get_transactions("budget-123", account_id="account-456")


#### `get_categories(budget_id: str)`
Get all categories organized by category groups.```json
{
  "budget_id": "budget-123",
  "category_groups": [
    {
      "id": "group-1",
      "name": "Monthly Bills",
      "categories": [
        {
          "id": "cat-1",
          "name": "Rent",
          "budgeted": 1000.00,
          "activity": -1000.00,
          "balance": 0.00
        }
      ]
    }
  ]
}

get_payees(budget_id: str)

Get all payees for a budget.

analyze_spending(budget_id: str, category_id?: str, since_date?: str, account_id?: str)

Analyze spending patterns with insights and statistics.

Parameters:
- budget_id (required): The budget UUID
- category_id (optional): Filter to specific category
- since_date (optional): Start date for analysis (defaults to 30 days ago)
- account_id (optional): Filter to specific account

Returns:```json
{
"summary": {
"total_spent": 750.50,
"transaction_count": 15,
"average_transaction": 50.03,
"daily_average": 25.02
},
"top_payees": [
{"payee": "Whole Foods", "amount": 200.00},
{"payee": "Shell", "amount": 150.00}
]
}


### Available Resources

MCP resources provide formatted, read-only data:

#### `ynab://budgets/{budget_id}/summary`
Comprehensive budget summary with accounts and categories.

#### `ynab://budgets/{budget_id}/accounts`
Formatted account balances.

#### `ynab://budgets/{budget_id}/categories`
Category spending overview with usage percentages.

## Development

### Development Workflow

Using Task (recommended):```bash
# Run all quality checks (format, lint, security, typecheck, test)
task check

# Run specific checks
task fmt           # Format code
task lint          # Lint code
task security      # Run security scans
task typecheck     # Type check with mypy
task test          # Run tests with coverage

# Run pre-commit hooks manually
task pre-commit

# See all available tasks
task --list

Or using uv directly:```bash

Run tests

uv run pytest
uv run pytest --cov # With coverage
uv run pytest tests/test_tools.py # Specific file

Code quality

uv run ruff format src/
uv run ruff check src/
uv run mypy src/

Security

uv run bandit -r src/ -ll
uv run pip-audit


### Pre-commit Hooks

Pre-commit hooks automatically run on every commit:

- **Ruff** - Format and lint code
- **Bandit** - Security checks
- **MyPy** - Type checking
- **detect-secrets** - Secret detection
- File quality checks (trailing whitespace, YAML syntax, etc.)

To run manually:```bash
task pre-commit
# or
uv run pre-commit run --all-files

Project Structure```

ynab-mcp-server/
src/
ynab_mcp_server/
init.py # Package initialization
main.py # Entry point
config.py # Configuration management
ynab_client.py # YNAB API wrapper
server.py # MCP server with tools & resources
tests/
conftest.py # Pytest fixtures
test_tools.py # Tool tests
test_resources.py # Resource tests
.env.example # Example environment variables
.gitignore # Git ignore rules
pyproject.toml # Project configuration
README.md # This file


## Security Best Practices

### API Token Security

1. **Never hardcode tokens** - Always use environment variables
2. **Use `.env` files** for local development (already in `.gitignore`)
3. **Rotate tokens regularly** - Every 60-90 days recommended
4. **Monitor token usage** - Check YNAB developer settings for unusual activity
5. **Use separate tokens** - Different tokens for development/production

### Configuration Validation

The server validates configuration at startup:
- Checks for required `YNAB_API_TOKEN`
- Rejects placeholder values like "your_token_here"
- Validates log level is a valid option
- Fails fast with clear error messages

### Error Handling

- API tokens are never exposed in error messages
- Authentication errors are logged without token details
- Generic errors returned to users, detailed logs for debugging
- All API calls wrapped in try-catch blocks

### Input Validation

- Budget IDs, account IDs, and dates are validated
- Pydantic models ensure type safety
- SQL injection not applicable (uses YNAB REST API)
- XSS not applicable (no web interface)

## API Rate Limits

YNAB API has rate limits:
- **200 requests per hour** per access token
- Rate limit resets hourly
- Server handles 429 responses gracefully
- Consider caching for production use

## Troubleshooting

### "Invalid YNAB API token" Error

- Check your token in `.env` matches the one from YNAB Developer Settings
- Ensure token hasn't been revoked
- Try generating a new token

### "Budget not found" Error

- Verify the budget_id is correct (get it from `get_budgets()` tool)
- Ensure your token has access to the budget
- Check budget hasn't been deleted

### Tests Failing```bash
# Reinstall dependencies
uv sync --all-extras

# Clear pytest cache
rm -rf .pytest_cache

# Run with verbose output
uv run pytest -vvs

Import Errors```bash

Reinstall in editable mode

uv pip install -e .


## Contributing

This is a personal project, but suggestions and feedback are welcome!

### Development Workflow

1. **Setup**: `task setup` - Install dependencies and pre-commit hooks
2. **Develop**: Make your changes
3. **Quality Checks**: `task check` - Run all quality checks
4. **Test**: Ensure all tests pass
5. **Commit**: Pre-commit hooks will automatically run
6. **Update Docs**: Update README for new features

### Before Submitting```bash
# Run all quality checks
task check

# This runs:
# - Code formatting (ruff format)
# - Linting (ruff check)
# - Security scans (bandit, pip-audit)
# - Type checking (mypy)
# - Tests with coverage (pytest)

Pre-commit hooks will automatically enforce these checks on commit.

Security

For security concerns and vulnerability reporting, please see our Security Policy.

Quick Security Checklist:
- ✅ Keep YNAB API tokens in .env (never commit)
- ✅ Run task security to scan for vulnerabilities
- ✅ Update dependencies regularly with uv sync --upgrade
- ✅ Review pre-commit hooks are working: task pre-commit

Report security vulnerabilities privately to: mit.arun07@gmail.com

License

MIT License - see LICENSE file for details.

Resources

  • YNAB API Documentation
  • Model Context Protocol
  • uv Package Manager
  • FastMCP Framework

Changelog

v0.1.0 (2025-11-22)

  • Initial release
  • Read-only tools for budgets, accounts, transactions, categories, and payees
  • Spending analysis with top payees and statistics
  • MCP resources for formatted budget data
  • Comprehensive test coverage
  • Security best practices implementation

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
Ynab MCP Server 4f5462c4 怎么安装?

在客户端按下面的安装命令接入:uv run pre-commit install。装完在客户端配置里引用同一个包或端点。

Ynab MCP Server 4f5462c4 怎么在 Claude Desktop、Claude 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

Ynab MCP Server 4f5462c4 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Ynab MCP Server 4f5462c4 需要 API Key 吗?

资料标注需要Token认证,使用前准备好对应凭据,并按最小权限配置。

Ynab MCP Server 4f5462c4 支持哪些客户端?

资料标注支持 Claude Desktop、Claude;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

Ynab MCP Server 4f5462c4 能提供哪些能力?

资料显示约 6 个工具;能力标签包括 Python、Claude、数据分析。具体工具清单以官方文档为准。

Ynab MCP Server 4f5462c4 需要什么运行环境?

运行时为 Python;属于本地进程,需要在本机装好运行环境。

Ynab MCP Server 4f5462c4 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。