purchase-app-mcp
This MCP server exposes 27 authenticated tools for managing a personal purchase/accounting/todo/project/budget/statistics app.
Purchases: list/filter, get, create, update (including status advancement with side effects), and delete purchase records.
Expenses/accounting: list/filter income, expense, and purchase records; create, update, and delete entries with category/project/split support.
Todos: list/filter, create recurring tasks, update (auto-renew recurring tasks on completion), and soft-delete or purge.
Projects: list summaries or full details, get, create (auto-creates P0–P5 phases), update, and delete with phase cascade and unlink behavior.
Phases: list project phases and set phase status (
todo,doing,done,skipped), with P5 completion rules.Budgets: read the budget document and save budgets by replacing all data or setting a single month’s total.
Recurring items and categories: read and update recurring/category documents via full replace or shallow patch.
Analytics: monthly summary of purchases, expenses, income, net spend, installments, budget usage, category top items, status counts, and month-over-month comparison.
Read-only checks: use list/get tools such as
purchase.listfor verification without modifying data.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@purchase-app-mcp show me this month's spending summary and budget usage"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
purchase-app-mcp
把「个人管家」App 的采购 / 记账 / 待办 / 项目 / 预算 / 统计数据以 MCP 工具暴露给任意 agent(Claude Code、Cursor、IDE agent、自建 agent 均可)。
每个安装实例用自己的 App 账号登录,凭据只存本机;仓库里没有任何硬编码 token / 密码 / 服务端密钥。
给 agent:一次性安装链接(全自动,推荐)
App v3.0.1+ 的「设置 → 连接 Agent(MCP)」可以生成一条形如 https://<你的App>/agent#t=<票据> 的链接。把链接交给 agent,它只需要运行:
npx -y github:begin2019510/purchase-app-mcp install "<链接>"这一条命令会:
注册 MCP 并安装 skill(等价于
setup);用票据向 App 换取该安装实例独立的 refresh token;
调用
purchase.list做一次只读验证,成功时输出INSTALL_OK。
链接 10 分钟内有效、只能兑换一次;生成新链接会让该账号之前未使用的链接立即失效。票据放在 URL 的 # 片段中,不会随请求出现在服务器日志或 Referer 里。
全程不需要 App 密码,agent 也不应索要密码。每个 agent 用各自生成的链接,就得到各自独立的凭据,可以单独 logout 吊销。
已登录的安装也可以为另一个 agent 生成链接:
npx -y github:begin2019510/purchase-app-mcp link
# 输出 JSON:{ "ok": true, "url": "...", "expiresAt": "...", "command": "..." }给 agent 的完整安装/使用规则见 AGENTS.md。
Related MCP server: Qianji Bridge MCP Server
给 agent:skill 链接(另一种方式)
把下面任一链接发给 agent:
https://github.com/begin2019510/purchase-app-mcp/blob/main/skills/purchase-app/SKILL.md
raw:
https://raw.githubusercontent.com/begin2019510/purchase-app-mcp/main/skills/purchase-app/SKILL.md
agent 读取后会执行 npx -y github:begin2019510/purchase-app-mcp setup:自动注册 MCP、把 skill 安装到 ~/.claude/skills/purchase-app/,然后引导用户完成一次登录。
MCP 提供工具,skill 提供「安装 + 登录 + 验证 + 安全使用」步骤。skill 本身不接触密码或 token。
安全模型(如何保证受信)
保证 | 做法 |
必须鉴权 | 未登录时所有数据工具返回 401 类错误,必须先 |
每安装独立凭据 | 每次登录换取独立的 refresh token(30 天,轮换),存本机 |
不共享写死 token | 代码与仓库中无任何 token;登录用 App 账号密码,密码不落盘、不写日志 |
可单独吊销 |
|
安装链接安全 | 票据 32 字节随机数,数据库只存 SHA-256;10 分钟有效、原子单次兑换;生成新链接即作废旧链接;票据只在 URL 片段中,不随请求上传 |
最小权限 | 只调用 App 已公开的业务 API;无用户管理、无部署/重启、无 shell、无数据库直连 |
传输安全 | 只接受 HTTPS App 地址(本机调试才允许 |
可审计 | 本机 |
信任边界:安装了这个 MCP 且完成登录的 agent,拥有该 App 账号的数据读写权限。请只在自己信任的 agent 中配置;不再使用时执行 logout。
安装
要求:Node.js >= 18.17;安装时需要能访问 GitHub 和 npm registry(本机 npm 已配置 npmmirror 时更快)。MCP 只访问你自己的 App 地址,不依赖本仓库的服务器。
一键 setup(推荐)
npx -y github:begin2019510/purchase-app-mcp setupClaude Code:用官方 CLI 注册为用户级 MCP,并安装 skill;
已注册则跳过,幂等;
只写配置和 skill,不登录、不写凭据;
其他 agent / 只看配置:
npx -y github:begin2019510/purchase-app-mcp setup --print输出纯 JSON(mcpServers.purchase-app + skill 路径/链接 + 命令),不写任何文件。也可以直接写指定的 JSON 配置:
npx -y github:begin2019510/purchase-app-mcp setup --agent json --config <配置文件路径>每个 agent 独立凭据:加 --home <独立目录>,然后分别登录。
Claude Code(手动)
claude mcp add purchase-app -s user \
-e PURCHASE_APP_MCP_HOME=$HOME/.config/purchase-app-mcp \
-- npx -y github:begin2019510/purchase-app-mcp通用 MCP 客户端(JSON)
{
"mcpServers": {
"purchase-app": {
"command": "npx",
"args": ["-y", "github:begin2019510/purchase-app-mcp"]
}
}
}Cursor:写入 ~/.cursor/mcp.json;其他客户端使用各自的 mcpServers 配置格式。
从源码运行
git clone https://github.com/begin2019510/purchase-app-mcp.git
cd purchase-app-mcp
npm install
node bin/purchase-app-mcp.js login登录(有两条路,二选一)
有安装链接:用上面的
install "<链接>",不需要密码,也不需要本机浏览器。本机登录(没有链接时):
npx -y github:begin2019510/purchase-app-mcp login有图形界面(macOS、Windows、Linux 的 DISPLAY/WAYLAND_DISPLAY)时会自动打开浏览器;否则终端打印 http://127.0.0.1:<port>/login/<一次性随机串>,在浏览器打开并输入 App 账号(默认 admin)和密码。可用 --no-open 禁止自动打开。
密码只用于向 App 的 HTTPS 登录接口换取 token,不会保存。
只把 refresh token 写入
~/.config/purchase-app-mcp/auth.json(目录 0700、文件 0600)。access token 24 小时有效、自动续期;refresh token 30 天有效、每次续期轮换。
登录后无需重启 agent:MCP 进程会在下一次工具调用时自动读取新凭据。
无浏览器的服务器(推荐用安装链接,见文首;没有链接时二选一):
# 方式 0(推荐):让用户在 App 设置页生成一次性安装链接,然后
npx -y github:begin2019510/purchase-app-mcp install "<链接>"
# 方式 1:SSH 端口转发(login 会打印实际端口)
ssh -L 127.0.0.1:<port>:127.0.0.1:<port> user@server
# 然后在本地浏览器打开 login 打印的地址
# 方式 2:一次性环境变量登录(密码不落盘,注意 shell 历史/进程环境)
read -rs PURCHASE_APP_PASSWORD
export PURCHASE_APP_PASSWORD
npx -y github:begin2019510/purchase-app-mcp login
unset PURCHASE_APP_PASSWORD多 agent 隔离(推荐)
默认所有 agent 共用当前系统用户的凭据目录。若希望每个 agent 独立登录、独立吊销,在各自的 MCP 配置里指定独立目录:
{
"mcpServers": {
"purchase-app": {
"command": "npx",
"args": ["-y", "github:begin2019510/purchase-app-mcp"],
"env": {
"PURCHASE_APP_MCP_HOME": "/home/me/.config/purchase-app-mcp/work-agent"
}
}
}
}然后分别执行:
PURCHASE_APP_MCP_HOME=/home/me/.config/purchase-app-mcp/work-agent \
npx -y github:begin2019510/purchase-app-mcp login共用同一目录也安全:refresh token 轮换有跨进程文件锁,不会互相踢下线;只是无法按 agent 单独吊销。需要单独吊销时用独立目录。
常用命令
npx -y github:begin2019510/purchase-app-mcp install "<链接>" # 一次性链接:注册 + 授权 + 只读验证
npx -y github:begin2019510/purchase-app-mcp link # 生成给别人用的一次性安装链接
npx -y github:begin2019510/purchase-app-mcp status # 查看登录状态、凭据路径
npx -y github:begin2019510/purchase-app-mcp logout # 删除本机凭据并吊销服务端 refresh token
npx -y github:begin2019510/purchase-app-mcp login # 本机网页登录(有桌面自动开浏览器)环境变量
变量 | 说明 |
| App 地址,默认 |
| 凭据/审计目录,默认 |
| 登录用户名,默认 |
| 仅用于无浏览器环境的一次性登录;不保存 |
工具(27 个)
采购:
purchase.listpurchase.getpurchase.createpurchase.updatepurchase.delete记账:
expense.listexpense.createexpense.updateexpense.delete待办:
todo.listtodo.createtodo.updatetodo.delete项目:
project.listproject.getproject.createproject.updateproject.deletephase.listphase.status.set预算:
budget.getbudget.save重复项 / 分类:
recurring.listrecurring.updatecats.listcats.update统计:
analytics.summary(月度收入、采购、净支出、分期、预算使用率、分类 TOP、环比)
写操作全部走 App 真实业务 API,服务端的状态联动(审批、待办生成、分期、预算规则等)照常生效。
阶段工具与版本要求
phase.list 与 phase.status.set 都走 App 公网 API。App 3.0.0+(2026-10 版本线重置;此前 4.0.52–4.0.61 同样包含)已部署 /api/phases 与 /api/phase-items,阶段状态/规划时间/交付物均可用。
如果调用返回「接口返回了网页而不是 JSON」,说明目标 App 的部署版本过旧(缺少阶段端点);先升级 App。旧部署也可临时使用仓库内的 app-patch/functions/api/phases.js 补丁,但不再推荐。
数据与隐私
本 MCP 不收集、不上传任何数据;所有请求直接从你的机器发往你自己的 App 地址(默认 https://121212121.top)。凭据与审计日志只保存在本机。
License
MIT
Available Tools
27 toolsanalytics.summary月度统计ARead-only
按月汇总:采购/记账/收入/净支出/分期应还/预算使用率/分类 TOP/状态计数,并与上月比较。month 不传则取当前月(东八区)。
Inputs: month.
budget.get读取预算ARead-only
读取预算文档(键为 YYYY-MM,值为该月预算总额)。
Inputs: no named parameters.
budget.save保存预算A
保存预算。传 data 整体替换;或传 month + total 设置单月预算(会自动与现有数据合并)。
Inputs: data, month, total.
cats.list分类列表CRead-only
读取自定义分类文档。
Inputs: no named parameters.
cats.update更新分类A
保存分类。data 整体替换;patch 与现有文档浅合并(如 {list: [...]})。
Inputs: data, patch.
expense.create记一笔C
新增收支记录。金额 0~999999;type 默认支出。
Inputs: amount (required), date, note, type, +5 more.
expense.delete删除记账CDestructive
删除记账记录。
Inputs: id (required).
expense.list记账列表BRead-only
列出记账(收支)记录,可按类型/分类/项目/关键词/日期区间筛选。
Inputs: to, from, type, limit, +3 more.
expense.update更新记账D
更新记账记录字段。
Inputs: id (required), date, note, type, +6 more.
phase.list阶段列表ARead-only
列出项目阶段(不传 projectId 则返回全部项目的阶段)。
Inputs: projectId.
phase.status.set设置阶段状态B
设置阶段状态(todo/doing/done/skipped)。P5 为最终阶段,不能 skipped;P5 done 时项目自动通关。
Inputs: status (required), phaseIdx (required), projectId (required), note, +1 more.
project.create新建项目C
新增项目,服务端自动创建 P0~P5 六个阶段。
Inputs: name (required), color, budget, status, +2 more.
project.delete删除项目ADestructive
删除项目并级联删除阶段/交付物;关联的采购/记账/待办解除关联(不删数据)。
Inputs: id (required).
project.get项目详情ARead-only
按 ID 获取项目完整信息(阶段、交付物、花费与流水)。
Inputs: id (required).
project.list项目列表ARead-only
列出项目。默认返回摘要(含阶段状态与花费合计);detail=true 返回完整阶段/交付物/流水。
Inputs: detail, status.
project.update更新项目C
更新项目基本信息或当前阶段指针。
Inputs: id (required), name, color, budget, +4 more.
purchase.create新建采购B
新增采购记录。quick=true 直接记为已到;status 不传则默认待审批(quick 时为已到)。
Inputs: name (required), qty, date, note, +14 more.
purchase.delete删除采购ADestructive
删除采购记录,并清理其联动待办。
Inputs: id (required).
purchase.get采购详情CRead-only
按 ID 获取单条采购记录。
Inputs: id (required).
purchase.list采购列表BRead-only
列出采购记录(按状态/分类/项目/关键词/日期区间筛选)。日期为毫秒时间戳;limit 取最近 N 条。
Inputs: to, from, limit, status, +3 more.
purchase.update更新采购B
更新采购字段或推进状态(状态推进时服务端会联动生成/完成待办、生成分期待办)。
Inputs: id (required), qty, date, name, +17 more.
recurring.list重复项列表CRead-only
读取重复收支/固定项文档。
Inputs: no named parameters.
recurring.update更新重复项B
保存重复项。data 整体替换;patch 与现有文档浅合并(如 {items: [...]})。
Inputs: data, patch.
todo.create新建待办C
新增待办。repeat 为每天/每周/每月时,完成后服务端自动生成下一条。
Inputs: title (required), tags, order, linkId, +9 more.
todo.delete删除待办ADestructive
默认软删(状态置已删除);purge=true 彻底删除。
Inputs: id (required), purge.
todo.list待办列表BRead-only
列出待办,可按状态/分类/优先级/项目/关键词筛选。
Inputs: limit, status, keyword, category, +2 more.
todo.update更新待办C
更新待办字段;status=已完成 且 repeat 非无 时自动续期下一条。
Inputs: id (required), tags, order, title, +11 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 27 tools
Most tools are cleanly scoped by resource and action (purchase.*, expense.*, todo.*, project.*), so an agent can distinguish them. Minor ambiguity exists between document-level tools like recurring.update and cats.update, and between project.update (phase pointer) and phase.status.set.
The dominant pattern is resource.action in dot notation (purchase.create, todo.update, budget.get), which is consistent and readable. Deviations like phase.status.set and the list/get/create/update/delete/save verb mix are minor.
27 tools is on the heavy side, but they are spread across nine coherent domains (purchase, expense, todo, project, phase, budget, analytics, recurring, categories). Each tool mostly earns its place, though the surface is near the upper bound of comfortable tool counts.
Core lifecycles are well covered: full CRUD for purchase, expense, todo, and project, plus phase status control, budgets, analytics, and recurring/category documents. Small gaps remain, such as explicit create/delete operations for recurring items and categories (handled indirectly via update), but these are workable.
Related MCP Connectors
Log, query, and edit expenses, budgets, and accounts in Manilo (formerly Ledgy) from any MCP-compatible AI assistant.
Log, query, and edit expenses, budgets, and accounts in Manilo from any MCP-compatible AI assistant.
Track agent ROI and enrich companies via MCP. Remote, OAuth 2.1, no install or keys.
Connect your First AI Employee workspace to review authorized business records, including contacts, tasks, calls, bookings, forms and reports. Prepare supported changes as an exact preview for approval before applying them. OAuth sign-in is required; available tools depend on account permissions, enabled products and access. Website: https://firstaiemployee.com/ . Setup: https://developer.firstaiemployee.com/mcp/
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to create, read, and manage tasks and projects in a personal todo system through MCP tools.1MIT
- FlicenseNot gradedqualityCmaintenanceEnables ChatGPT to read and analyze a self-hosted Qianji ledger through 15 MCP tools exposed over OpenAI's Secure MCP Tunnel, covering login, sync, multi-ledger queries, bill details and filtering, income/expense statistics, budget progress, profile lookup, and CSV/JSON export. Also supports gated create, edit, delete, refund, and reimbursement operations that are permitted only after verification against a user-designated test ledger.2-
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants and agents to securely query, reconcile, analyze, and manage personal finances in Actual Budget through MCP tools and APIs.672 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP-capable AI clients to read and write a self-hosted todo list, quick memos, and a plain-Markdown knowledge base through 16 tools covering search, tasks, notes, and identity checks. Tool visibility is scoped per API key with directory-level permissions, and every call is audit-logged.5MIT