Skip to main content
Glama
yazkyChristianNicolas

personal-finance-mcp-server

personal-finance-mcp-server

用于 personal-finance-service 的远程 MCP 服务器: 将其业务操作(分组、支付方式、支出)作为 MCP 工具暴露, 通过 Keycloak 进行身份验证。设计用于从 Kiro/Claude(交互式登录)或 云中的无头代理(M2M 登录)使用。

要求

  • Docker + Docker Compose

  • personal-finance-service 正在运行(在该仓库中执行 docker compose up -d)—— 本服务器连接到其 Keycloak 和 API,不会自行启动它们。

Related MCP server: MCP Agent - AI Expense Tracker

如何运行

cp .env.example .env
# completar KEYCLOAK_CLIENT_SECRET con el secret de mcp-personal-finance-server
# (ver "Setup de Keycloak" en AGENTS.md si todavía no existen los clients)
docker compose up -d --build
  • GET http://localhost:8000/health

  • POST http://localhost:8000/mcp — 需要 Authorization: Bearer <jwt>

在 Kiro 中配置 MCP

{
  "mcpServers": {
    "personal-finance-remote": {
      "url": "http://localhost:8000/mcp",
      "oauth": {
        "clientId": "mcp-personal-finance-client",
        "scopes": []
      }
    }
  }
}

首次使用时,Kiro 会打开浏览器进行 Keycloak 登录——使用 你在 personal-finance-service 中已经使用的相同用户名/密码。

可用工具

工具

功能

search_groups

列出用户的群组

create_group

创建群组

search_group_members

列出群组成员

search_payment_methods

列出用户的支付方式

create_payment_method

创建支付方式

patch_payment_method

修改支付方式

delete_payment_method

删除支付方式

search_expenses

列出支出,支持筛选

create_expense

记录支出(可选分期和/或分摊)

close_expense_cycle

为信用卡分期支出生成下一期

get_expense

支出的完整详情

patch_expense

修改支出

delete_expense

删除支出

personal-finance-service 的 API 密钥管理(创建/列出/删除) 有意不作为工具暴露——参见 AGENTS.md。

无头代理(M2M)

对于没有人类用户背后的代理(无法进行交互式登录),请使用客户端凭据授权(Client Credentials Grant)而不是 Kiro 的流程:

curl -X POST http://localhost:8080/realms/personal-finance/protocol/openid-connect/token \
  -d "grant_type=client_credentials&client_id=mcp-personal-finance-agent&client_secret=$AGENT_CLIENT_SECRET" \
  | jq -r .access_token

使用该 access_token 作为 Bearer 令牌调用 POST /mcp。代理还需要 在其环境中配置 UPSTREAM_API_KEY——一个由真实用户预先生成的 Personal Finance API 密钥(在 personal-finance-service 中执行 POST /api-keys), 因为其令牌不代表该 API 的任何真实用户。

更多详情

参见 AGENTS.md——设计决策、已知差距,以及为什么认证透传 有效(以及何时会失效)。

Related MCP Connectors

Related MCP Servers

  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables AI tools to interact with Firefly III personal finance management instances through a cloud-deployed MCP server. Supports financial operations like account management, transactions, budgeting, and reporting with configurable tool presets.
    17 npm
    -
  • A
    license
    B
    quality
    B
    maintenance
    Enables agent-friendly access to Monarch Money finances, including accounts, transactions, budgets, cash flow, and mutations through structured MCP tools.
    33
    MIT
  • F
    license
    C
    quality
    C
    maintenance
    Enables users to add expenses, retrieve expenses by date range, and get spending summaries by category through MCP tools.
    4
    -