使用说明
mcp-ynab
FastMCP服务器公开 YNAB API 通过MCP使用YNAB发布的OpenAPI规范。
需求
- Python 3.12+
- YNAB个人访问令牌
uv(推荐)或pip
配置
环境变量:
YNAB_TOKEN(必需):您的YNAB API令牌TRANSPORT(可选):http(默认)或stdio
在本地运行
使用 uv:
uv sync
export YNAB_TOKEN="your_token_here"
export TRANSPORT="http" # optional, defaults to http
uv run python main.py
HTTP模式启动服务器 0.0.0.0:8080.
码头工人
使用GHCR中的预构建映像:
docker pull ghcr.io/alexfu/mcp-ynab:latest
在HTTP模式下运行预构建映像:
docker run --rm -p 8080:8080 \
-e YNAB_TOKEN="your_token_here" \
-e TRANSPORT="http" \
ghcr.io/alexfu/mcp-ynab:latest
在stdio模式下运行预构建映像:
docker run --rm \
-e YNAB_TOKEN="your_token_here" \
-e TRANSPORT="stdio" \
ghcr.io/alexfu/mcp-ynab:latest
备注
- 服务器在启动时从以下位置获取YNAB的OpenAPI规范
https://api.ynab.com/papi/open_api_spec.yaml. - 如果出现以下情况,启动将失败
YNAB_TOKEN缺失,TRANSPORT无效,或规范请求失败。