通过 https://moneydata.cn/mcp 的 MCP 接口管理个人财务。
⚠️ 首次使用必须先完成认证。 详细流程见 references/auth.md。
认证流程概述:
> 关键提醒:
> - 选项一(微信Token):不需要保存身份标识ID,Token 本身已包含用户信息
> - 选项二(API获取):必须保存身份标识ID(32位,MAC 地址 MD5),Token 过期后用同一身份标识ID + 新时间戳即可换新 token;更换身份标识ID 会导致历史数据丢失!
| 工具 | ❌ 易错写法 | ✅ 正确写法 |
|---|---|---|
| ------ | ------------ | ------------ |
buy_asset | code: "600519" | price_code: "600519" |
buy_asset | price: 1268 | cost_unit_price: 1268 |
buy_asset | 不传币种 | pay_currency: "CNY" (必填!) |
sell_asset | 不传币种 | deposit_currency: "CNY" (必填!) |
income/expense | 不传币种 | currency: "CNY" (必填!) |
borrow/repay | 不传币种 | from_currency/to_currency: "CNY" (必填!) |
get_category_list | direction: "income" | direction: 1 (int) |
| 各工具数字参数 | "101" (string) | 101 (number) |
> 完整参数 schema 见 references/mcp-api.md,平台ID见 references/platform-ids.md,分类代码见 references/category-codes.md,认证流程见 references/auth.md
income(sub_category=10002, amount=1000, platform_id=101, currency="CNY", remark="比赛奖金")
income,不是 record_incomerecord_date: 可选 YYYY-MM-DDexpense(sub_category=20044, platform_id=101, amount=2000, currency="CNY", pay_mode="balance", remark="买手机")
pay_mode 枚举: balance(余额) | credit(信用卡),其他值报 [30018]repay 还款ai_expense(sub_category=20044, platform_id=101, amount=2000, currency="CNY", remark="AI AGENT买手机")
buy_asset(sub_category=1, price_code="600519", quantity=2, cost_unit_price=1268,
platform_id=1, from_platform_id=101, pay_currency="CNY")
platform_id: 存放平台(券商),from_platform_id: 扣款平台(银行),不传则同 platform_id600519/SH600519 均可,基金 F000051,黄金 UDFGOLD001sell_asset(sub_category=1, price_code="SH600519", platform_id=1, quantity=1,
sell_unit_price=1300, deposit_currency="CNY", to_platform_id=101)
get_asset_list 返回的格式(A股 SH600519,港股 HK00700)remaining_quantity(剩余持有)、realized_profit(盈亏)、deposit_asset_idborrow(from_sub_category=46, from_platform_id=101, from_currency="CNY",
to_sub_category=21, to_platform_id=105, to_currency="CNY", quantity=100000)
repay(from_sub_category=21, from_platform_id=101, from_currency="CNY",
to_sub_category=49, to_platform_id=101, to_currency="CNY", quantity=100)
| 工具 | 用途 | 关键提醒 |
|---|---|---|
| ------ | ------ | ---------- |
get_asset_list | 资产列表 | 证券 category=0(非10);看 base(CNY) 非 original;include_cleared(bool)含已清仓 |
get_liability_list | 负债列表 | 看 remaining_amount,⚠️ base.total_value 可能=0 |
get_transaction_list | 交易记录 | biz_type: buy_asset/sell_asset/income/expense/repay/borrow/transfer |
get_dashboard_summary | 财富看板 | 总资产/总负债/净资产/月年变化 |
get_income_summary | 收入汇总 | 传 category 按二级汇总,不传按一级 |
get_expense_summary | 支出汇总 | 同上 |
get_category_list | 分类列表 | 可按 direction 过滤;每天刷新引用 |
get_platform_list | 平台列表 | 可按 sub_category 过滤;每天刷新引用 |
get_category_list() 获取最新分类数据,当天后续使用直接引用,不要硬编码分类代码get_platform_list() 获取最新平台数据,当天后续使用直接引用,不要硬编码平台IDpay_currency="CNY",系统自动按汇率折算扣款remaining_amount(待还金额)references/errorcode.md共 2 个版本