Money Lover MCP Server
Money Lover MCP 服务器
这是一个 Node.js 实现的模型上下文协议 (MCP) 服务器,封装了非官方的 Money Lover REST API。该服务器公开了 27 个 MCP 工具,涵盖身份验证、钱包、分类、交易、事件、债务和静态配置,使 AI 助手或兼容 MCP 的客户端能够查询和管理个人财务数据。
功能特性
通过
EMAIL/PASSWORD环境变量自动进行身份验证 — 大多数工具无需传递令牌。23 个读取工具,涵盖用户信息、钱包、分类、交易、事件、债务、图标、提供商和静态配置。
4 个写入工具:创建、更新和删除交易、钱包和分类。
大响应自动截断,以保持 LLM 上下文可控(可通过
limit参数配置)。基于 Stdio 的服务器,兼容 Claude Code、Claude Desktop、Cursor 以及任何 MCP 主机。
每个邮箱的令牌缓存位于
~/.moneylover-mcp/下,并在身份验证错误时自动刷新。
Related MCP server: YNAB Assistant
前置要求
Node.js 22 或更高版本。
Money Lover 账户凭据。
安装
npm install使用
通过 stdio 启动 MCP 服务器:
npm start项目级配置 (Claude Code)
在项目根目录添加 .mcp.json:
{
"mcpServers": {
"mcp-moneylover": {
"command": "node",
"args": ["/absolute/path/to/moneylover-mcp/src/server.js"],
"env": {
"EMAIL": "your@email.com",
"PASSWORD": "your-password"
}
}
}
}并在 .claude/settings.json 中启用它:
{ "enabledMcpjsonServers": ["mcp-moneylover"] }全局配置 (Claude Desktop / Cursor)
{
"mcpServers": {
"mcp-moneylover": {
"command": "npx",
"args": ["@ferdhika31/moneylover-mcp@latest"],
"env": {
"EMAIL": "your@email.com",
"PASSWORD": "your-password"
}
}
}
}可用工具
身份验证 (Auth)
工具 | 描述 | 参数 |
| 获取 JWT 令牌。 |
|
用户 (User)
工具 | 描述 | 参数 |
| 与会话关联的个人资料。 | — |
| 设备和活动会话。 | — |
| 扩展的个人资料数据。 | — |
钱包 (Wallets)
工具 | 描述 | 参数 |
| 列出所有钱包。 | — |
| 钱包余额摘要。 |
|
| 与其他用户共享的钱包。 | — |
| 待处理的共享邀请。 | — |
| 创建新钱包。 |
|
| 更新钱包名称、图标或货币。 |
|
| 永久删除钱包。 |
|
分类 (Categories)
工具 | 描述 | 参数 |
| 特定钱包的分类。 |
|
| 所有钱包中的所有分类。 | 可选 |
| 在钱包中创建分类。 |
|
| 重命名分类或更改其图标。 |
|
| 删除分类。 |
|
交易 (Transactions)
工具 | 描述 | 参数 |
| 日期范围内的交易。 |
|
| 创建交易。来自 |
|
| 更新交易。API 要求每次编辑都提供完整载荷 — 如果需要当前值,请先获取交易。 |
|
| 删除交易。 |
|
| 带有可选过滤器的自由格式搜索。 | 可选 |
| 标记为债务/贷款的交易。 | — |
| 按 ID 列表关联的交易。 |
|
| 按分类关联的交易。 |
|
| 按钱包关联的交易。 |
|
| 可用的搜索过滤选项。 | 可选 |
静态与配置 (Static & Config)
工具 | 描述 | 参数 |
| 钱包的储蓄目标/事件。 |
|
| 钱包中的未结债务。 |
|
| 图标包元数据。 | 可选 |
| 支持的银行提供商。 | — |
| 货币目录。 | 可选 |
| 基于美元的汇率快照。 | — |
| 其他运行时配置。 | — |
工具使用示例
每个工具的提示示例、必需与可选字段、注意事项以及常见的步骤模式:docs/examples.md。
库使用
import { MoneyloverClient } from './src/moneyloverClient.js';
const token = await MoneyloverClient.getToken(email, password);
const client = new MoneyloverClient(token);
const wallets = await client.getWallets();
const txns = await client.getTransactions(walletId, '2026-01-01', '2026-04-30');
await client.addTransaction({ walletId, categoryId, amount: '50000', date: '2026-04-18' });
await client.editTransaction('txn-id', { amount: '60000', note: 'updated' });
await client.deleteTransaction('txn-id');测试
单元测试
模拟单元测试 — 无需实时 API 调用:
npm test集成测试 (mcp-tester)
mcp-tester 是一个基于 ReAct 代理的 MCP 测试框架。它启动服务器,驱动 LLM 根据自然语言提示调用工具,并断言调用了正确的工具且参数正确。
安装
pipx install --index-url https://pypi.artifacts.furycloud.io/simple/ mcp-tester配置
tests/mcp-tester/mcps.json — 使用您的凭据指向本地服务器:
{
"mcp-moneylover": {
"command": "node",
"args": ["/absolute/path/to/src/server.js"],
"transport": "stdio",
"env": {
"EMAIL": "your@email.com",
"PASSWORD": "your-password"
}
}
}运行
mcp-tester run-tests \
--mcps tests/mcp-tester/mcps.json \
--model gpt-4o-mini \
--concurrent-runs 3 \
tests/mcp-tester/read-tools.yaml结果
tests/mcp-tester/read-tools.yaml 包含 25 个集成测试,涵盖了每个读取工具:
total 25, success 25, failures 0使测试稳定的关键决策:
读取工具上没有令牌参数 — 公开可选的
token字段会导致 LLM 将钱包 ID 注入其中。服务器通过环境变量自动进行身份验证。响应截断 — 多个端点会从共享的 MoneyLover 数据库返回数十万条记录。工具接受
limit参数(默认:20–100)以保持 LLM 上下文可控。字典包装 — 所有工具响应都返回一个 JSON 对象(从不返回纯数组),以便通过 MCP 框架验证。
写入工具测试 (mcp-tester)
另外三个 YAML 文件测试了钱包、分类和交易在三个连续阶段的完整 CRUD 生命周期。每个阶段同时运行所有三种资源类型。
文件 | 阶段 | 测试 |
| 创建 |
|
| 编辑 |
|
| 删除 |
|
按顺序运行阶段 — 每个阶段都依赖于前一个阶段:
# Phase 1: Create
mcp-tester run-tests --mcps tests/mcp-tester/mcps.json --model gpt-4o-mini --concurrent-runs 3 tests/mcp-tester/write-create.yaml
# Phase 2: Edit (after Phase 1 passes)
mcp-tester run-tests --mcps tests/mcp-tester/mcps.json --model gpt-4o-mini --concurrent-runs 3 tests/mcp-tester/write-edit.yaml
# Phase 3: Delete (after Phase 2 passes)
mcp-tester run-tests --mcps tests/mcp-tester/mcps.json --model gpt-4o-mini --concurrent-runs 3 tests/mcp-tester/write-delete.yaml所有三个阶段的结果:
Phase 1 (Create): total 3, success 3, failures 0
Phase 2 (Edit): total 3, success 3, failures 0
Phase 3 (Delete): total 3, success 3, failures 0写入工具测试的关键设计决策:
变异前的发现 — 编辑和删除测试指示代理首先调用读取工具(
get_wallets,get_categories,get_transactions)以按名称定位目标,然后调用变异工具。这反映了代理在不知道 ID 的情况下在现实世界中的行为。写入工具断言的
args: !any— 该框架要求精确的参数匹配。写入工具接受代理可能自行包含的可选字段(icon,with等);!any验证工具被调用并成功,而不会因无害的额外内容而失败。读取工具断言可以使用精确的参数匹配,因为它们的模式中没有 LLM 会自发添加的可选字段。可预测的标识符 — 测试资源使用固定名称(
MCP-Test-Wallet,MCP-Test-Category)和固定备注(MCP test transaction),以便代理可以在编辑和删除阶段按名称定位它们,而无需在测试运行之间共享状态。完整载荷编辑断言 —
edit_transaction是一个完全替换操作;测试提示指示代理首先获取现有交易(get_transactions)并携带所有当前字段值,仅更改备注。这验证了工具描述所需的多步推理。
安全说明
切勿提交真实的凭据或令牌。
缓存的令牌位于
~/.moneylover-mcp/中,仅限当前用户访问。删除该目录以撤销所有缓存的会话。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with the WYGIWYH expense tracking API through 75 dynamically generated MCP tools. Supports comprehensive financial operations including transaction management, account handling, recurring expenses, and investment tracking.7
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with YNAB budgets through natural language. Supports managing accounts, categories, transactions, and budget months with 21 tools for comprehensive budget operations.
- AlicenseAqualityDmaintenanceEnables AI assistants to interact with Money Lover personal finance app through unofficial REST API. Supports authentication, wallet management, transaction querying, and creating new transactions for expense tracking.6204ISC
- AlicenseAqualityDmaintenanceEnables AI assistants to manage personal finances through the Realbyte Money Manager mobile app, providing transaction management, asset tracking, credit card monitoring, and financial analytics with 18 comprehensive tools.181711MIT
Related MCP Connectors
Log, query, and edit expenses, budgets, and accounts in Ledgy from any MCP-compatible AI assistant.
Connect AI agents to bank accounts, transactions, balances, and investments.
Gateway between LLM agents and world data through eight tools and a bundled endpoint catalog.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/juansebashr/moneylover-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server