qianji-mcp-server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| QIANJI_DB | No | 本地 SQLite 镜像路径(不同账号须使用独立文件)。 | ./data/qianji.db |
| QIANJI_TZ | No | 覆盖账务时区(IANA 时区名,如 Asia/Shanghai、Asia/Tokyo);默认使用系统时区。 | |
| QIANJI_LINE | No | 线路:client-api / client-qianji / client-qianjiga;默认跟随地区。 | |
| QIANJI_EMAIL | Yes | 钱迹登录邮箱或手机号。 | |
| QIANJI_REGION | No | 地区:cn / overseas。 | cn |
| QIANJI_BOOK_ID | No | 新增和转账默认使用的账本 ID(数字字符串,-1 为默认账本)。 | -1 |
| QIANJI_DEVNAME | No | 上游设备名,会显示在钱迹「登录设备」列表中。 | qianji-mcp-server |
| QIANJI_BASE_URL | No | 显式指定上游地址,设置后跳过地区与线路推导。 | |
| QIANJI_PASSWORD | No | 明文密码(启动时在内存中转为 MD5,不落盘)。与 QIANJI_PWD_HASH 二选一。 | |
| QIANJI_PWD_HASH | No | 密码的 32 位小写裸 MD5(推荐,优先于明文密码)。与 QIANJI_PASSWORD 二选一。 | |
| QIANJI_TIMEOUT_MS | No | 单次上游请求超时(毫秒)。 | 30000 |
| QIANJI_TRACE_FILE | No | 可选:将上游请求元数据写入 JSONL 排障(不含密码与 token)。 | |
| QIANJI_REMARK_STYLE | No | 备注风格 JSON 路径(文件存在才生效)。 | ./data/remark-style.json |
| QIANJI_TOOL_PROFILE | No | 工具配置:full(15 个工具)或 daily(13 个日常工具,隐藏 probe/sync)。 | full |
| QIANJI_LINE_FALLBACK | No | 读请求连不上时自动换同地区备用线,0 关闭。 | 1 |
| QIANJI_CLIENT_PROFILE | No | 客户端画像:fltwin(默认)/ 4.3.7 / 4.5.1b3。 | fltwin |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
小票用 qianji_record_receipt;手工收支用 qianji_create_bill。先搜索账户和分类,再原样使用 ID。 金额使用账户原币十进制字符串。小票照抄票面总额,只在跨币种结算后补实际扣款。当前完整支持 JPY / CNY。 每次写入用参数 requestId 或宿主 _meta[qianji/requestId] 提供稳定操作键。两处同时提供时必须一致。重试或补结算复用原键,unknown 按 nextCall 查回执。 收到 syncing 后按 retryAfterMs 查询 qianji_status。新增收支等 catalogs.accounts 和目标账本出现在 catalogs.categoryBooks,转账只等账户;首次历史查询和修改、删除等 mirror.initialSyncComplete。就绪后重试原调用。
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| qianji_record_receiptA | 从一张消费小票记一笔支出,照抄商户、票面时间和总额。跨币种实扣未知时只保存待结算小票。 |
| qianji_create_billA | 手工记一笔收入或支出。按账户原币填金额,小票改用 qianji_record_receipt。 |
| qianji_create_transferB | 记录两个账户间的实际转账。跨币种须填写实际到账金额,转账单独统计。 |
| qianji_update_billA | 修改一笔收支账单,changes 只填要修改的字段。换到不同币种的账户须同时提供实际金额。 |
| qianji_delete_billA | 根据确认过的账单 ID 删除账单,返回删除前的摘要。 |
| qianji_get_writeB | 用操作键查询单笔写入或待结算小票。未知状态触发回读核对。 |
| qianji_list_writesB | 按时间列最近的写入回执和本地待结算小票。 |
| qianji_list_booksB | 搜索账本,返回可用于记账的 bookId 与默认账本。 |
| qianji_search_categoriesA | 按账本、收支类型和名称搜索分类,选择具体路径后将 categoryId 传给写工具。 |
| qianji_search_accountsA | 按名称或 ID 搜索支付账户,返回 accountId、账户币种与原币余额。默认隐藏归档账户。 |
| qianji_list_billsC | 按日期、账户币种、分类 ID 或关键词查询账单。amount 为实扣或实收,originalReceipt 保留票面。 |
| qianji_get_statsB | 账户收支用 account;旅行消费原币用 receipt(仅本地有票面且已入账的账单)。按币种分别合计,可另取参考估值。 |
| qianji_statusA | 检查本地镜像规模、首次同步状态、账务时区和当前登录状态。本工具离线可用。 |
| qianji_probeA | 检查上游协议是否可达。mode=login 时额外验证配置的账号。 |
| qianji_syncC | 拉取账单并刷新本地镜像。complete 表示是否翻完全部页。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 15 tools
Most tools have clearly distinct purposes: manual bills, receipts, transfers, queries, and sync/status utilities are separated by descriptions. Slight potential overlap remains between create_bill and record_receipt, and between list_bills and get_stats, but descriptions resolve the intended boundary.
All tools use the qianji_ prefix and snake_case, with most following a verb_noun pattern such as create_bill or list_writes. status, probe, and sync are bare names without an object, which is a minor deviation but still readable and predictable.
Fifteen tools is well-scoped for a finance MCP covering bookkeeping writes, reads, reference data lookup, sync, and diagnostics. Each tool appears to serve a distinct workflow rather than duplicating another.
The surface covers bill create/update/delete/list, receipt recording, transfers, write status, books, categories, accounts, stats, sync, and diagnostics. Minor gaps likely exist around transfer modification or full book/account management, but core bookkeeping workflows are covered.