钱Qianji Bridge

Qianji API Service

钱迹 API 代理服务,提供 REST API 和 Streamable HTTP MCP。MCP 端点为 /mcp,当前 MCP 模式为 advanced。 可通过 QIANJI_MCP_MODE 设置为 read、write、advanced 或 full。 单次请求可用 ?mode=write 等 URL query 覆盖工具范围。

1 account(s) logged in. Current: fe***@g***.com
Account IDNameEmailDevice
fe***@g***.com迎***fe***@g***.comMCP_20261022_000241

Quick Links

MCP Modes

ModeTools
readLogin and read-only query tools
writeRead tools plus core bookkeeping tools: create_expense, create_income, create_transfer, their update variants, sync_bills, set_bill_cache_ttl and set_tags_enabled
advanced (default)Write tools plus refund, reimbursement, loan/debt asset, principal, collection and repayment tools
fullAll MCP tools, including low-level create_bill, update_bill, delete_bill, raw call_api and 112 upstream endpoint tools

Add MCP to Agent

Agent 使用 Streamable HTTP MCP 地址:https://qianji.x4ai.cn/mcp。 通过 Traefik 或域名访问本页时会自动使用当前域名;本地直接访问时使用当前本地调试地址。 MCP 使用钱迹账号的 MD5 密码等价凭据认证,Header 支持 Authorization: Bearer qj1.md5.account~pwd_hash 或 Authorization: Bearer qj1.md5-b64.base64_utf8(account~pwd_hash)。

Agent configJSON
{
  "mcpServers": {
    "qianji": {
      "type": "streamable-http",
      "url": "https://qianji.x4ai.cn/mcp",
      "headers": {
        "Authorization": "Bearer qj1.md5-b64.BASE64_ACCOUNT_TILDE_PWD_HASH"
      }
    }
  }
}

Key Endpoints

MethodPathDescription
POST/auth/loginValidate the Authorization credentials (optionally re-checks the plaintext password against the Bearer token)
GET/auth/statusCheck login status
GET/billsList bills newest-first (cache-backed, paginated)
GET/bills/rangeList bills in a time range (cache-backed)
POST/bills/syncSync bills from Qianji into the local cache
POST/billsCreate a new bill
DELETE/bills/{id}Delete a bill
GET/assetsList all assets
GET/categoriesList categories
GET/booksList books
GET/tagsList tags
GET/budgetsList budgets
GET/currenciesList currencies
POST/api/{ctrl}/{act}Generic API passthrough (all 112 endpoints)

Usage Example

REST API examplescurl
AUTH='Authorization: Bearer qj1.md5-b64.BASE64_ACCOUNT_TILDE_PWD_HASH'

# 1. Login status
curl http://localhost:50003/auth/status -H "$AUTH"

# 2. Query bills
curl http://localhost:50003/bills -H "$AUTH"

# 3. Create a bill (expense)
curl -X POST http://localhost:50003/bills \
  -H "$AUTH" \
  -H "Content-Type: application/json" \
  -d '{"bill_type":"expense","amount":25.5,"occurred_at":"2026-04-12T19:30:00+08:00","asset_id":123,"category_id":60559217,"remark":"lunch"}'

# 4. Generic API call
curl -X POST http://localhost:50003/api/asset/typelist \
  -H "$AUTH" \
  -H "Content-Type: application/json" -d '{}'

Qianji SDK v0.0.30 | Reverse-engineered API proxy | Local network only