
Whiteflow
io.github.Vishal4742由 GitHub 帳號 Vishal4742 發布v0.3.0更新於 Nov 7, 2026
USDT payment links, payments and collection summaries on Whitechain testnet. Can't move money.
概覽
本機 MCP 伺服器,讓助理為 Whiteflow 商戶建立 USDT 付款連結與發票草稿、查詢付款狀態並彙總收款情形。
- 可以做什麼
- 讀取商戶資料:運作模式、時區、幣別、付款方式、限額與權限
- 建立與查詢付款連結,並列出附有憑證的已驗證付款紀錄
- 管理客戶與發票草稿,並為已定稿發票提出發布請求、交由 Owner 核准
- 查詢發票狀態、逾期發票與未結清總額,並草擬不會自動寄出的催款提醒
- 依幣別彙總收款:總額、手續費、退款、淨額、付款筆數與應收款
- 適用情境
- 適合 Whiteflow 商戶在 AI 助理中草擬發票、產生付款連結並查看已收與未收款項。它目前是測試網與沙盒工具,並非正式環境的付款系統,適合評估與流程試用,而非實際收款。
- 執行需求
- 以 npm 套件(whiteflow-mcp)或打包的 .mcpb 擴充功能透過 stdio 在本機執行;打包版本需要 Node 20 或更新版本。沙盒模式為預設,無需帳號、網路或金鑰。測試網模式需要在 WHITEFLOW_API_KEY 提供商戶 sk_test_ 金鑰,並設定 WHITEFLOW_MODE,可選 WHITEFLOW_TIMEZONE。僅支援桌面用戶端。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Whiteflow,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Whiteflow Merchant MCP
Manage payment collection by asking your AI assistant: create payment links and invoices, check whether they're paid, see what's outstanding, and draft reminders. It's a local MCP server (stdio), packaged as whiteflow.mcpb for MCPB clients such as Claude Desktop, with a manual config for other clients.
Not production. It runs in one of two modes, and every result says which:
- Sandbox (the default): a simulator on your computer. No account, no network, no real money. URLs on
sandbox.whiteflow.invaliddon't open.- Testnet: the Whiteflow gateway on Whitechain Testnet with your
sk_test_key. Test USDT only. Payment links, payments and collection summaries are live once the gateway routes in PR #48 are deployed. Customers, invoices and reminders are not on the testnet backend yet, and those tools say so.
Install
Claude Desktop (.mcpb)
This builds dist/whiteflow.mcpb, plus whiteflow.mcpb.sha256 (the archive) and whiteflow.mcpb.contents.sha256 (its files). The archive also contains sbom.cdx.json, a CycloneDX list of every package bundled in it. Open the .mcpb with Claude Desktop, or use Settings → Extensions → Install extension. Then fill in the settings:
Check the archive before installing: sha256sum dist/whiteflow.mcpb (PowerShell: Get-FileHash dist\whiteflow.mcpb) must match whiteflow.mcpb.sha256. The archive's hash changes on every pack, because mcpb 2.1.2 stamps zip entries with the current time. The contents hash stays the same for the same source. A checksum only helps if you got it from a channel you trust: the archive isn't signed yet, and nothing proves who built it (see "what production needs").
Optional setting, environment only: WHITEFLOW_TRUSTED_ORIGINS, comma-separated https origins of an approved custom checkout domain. The connector shows payment and review URLs only on the gateway's own origin and these.
Other clients (manual stdio)
Build once (npm run pack), then point the client at the bundled server. For example, Claude Desktop's claude_desktop_config.json:
Claude Code: claude mcp add whiteflow --env WHITEFLOW_TIMEZONE=Asia/Kolkata -- node /absolute/path/to/packages/mcp/dist/bundle/server/index.mjs
For testnet, add "WHITEFLOW_MODE": "testnet" and "WHITEFLOW_API_KEY": "sk_test_…". Keep the default local scope in Claude Code: --scope project would write the key into the repo's .mcp.json. From a checkout, node src/index.ts also works (Node 22.18 or newer runs the TypeScript directly). The bundle needs Node 20 or newer and no node_modules.
Authentication
- Testnet: a merchant-scoped secret key (
sk_test_…) from the dashboard's Developers screen. The server works out your business from the key; no tool takes a merchant or business id.- Revoke a key on the same screen; the connector then gets 401 and tells you so.
- A publishable key (
pk_…) is refused. - Testnet keys have no scopes or expiry yet: a key can do everything the merchant API allows, though this connector only calls the routes in API-CONTRACT.md. Use a key just for the assistant, so you can revoke it alone.
- Sandbox: no key needed. A local sandbox key is created next to the sandbox data, owner-only. Sandbox keys do have scopes and expiry, so you can try a narrower key.
- Never give the connector a wallet private key, a seed phrase or a payment-provider master secret. It never asks for one, and no tool can use one.
- Where the key is stored. In an
.mcpbinstall, Claude Desktop keepssensitivesettings encrypted with Electron safeStorage, whose key is in the OS keychain (mcpb #41; help article). An open report says the settings panel can show them in plain text (mcpb #244). A manual config file holds the key in plain text, so protect that file.
Try the sandbox demo
In the assistant:
- "Find Priya Sharma, or add her with [email protected]."
- "Draft an invoice for Priya: three consulting sessions at 20 USDT each, due next Friday." The assistant shows the totals and the resolved date and waits for your OK.
- "Publish it." The assistant asks to publish this exact version. Nothing is published or emailed yet: the result gives an approval id (
apr_…) for the business Owner.
In a terminal, act as the Owner on the review page, then as the customer paying. In the sandbox the review page is the approve command. The pay command sends signed provider events, and the sandbox processes them like webhooks:
Back in the assistant: 4. "Has WF-1001 been paid?" It's paid, according to the processed payment record. 5. "Summarize collections this week." The summary shows the 60.00 USDT.
Scenarios for the simulator: --scenario duplicate | out-of-order | bad-signature | fail, and --amount 25 for an underpayment. npm run sandbox -- reconcile rebuilds each invoice's paid total from verified payments. The sandbox lives in %APPDATA%\whiteflow-mcp (Windows) or ~/.config/whiteflow-mcp, or in WHITEFLOW_STATE_DIR. Delete the folder to start over.
Example prompts
There are also prompt templates: Collect a payment, Create an invoice, Review overdue invoices and Summarize collections.
Tools
How writes behave (production review F2/F3):
- One operation identity. Each write sends an
Idempotency-Key, and the connector records it before sending. The server replays the same record for the same key and request, markedreplayed, and refuses the same key with a different request. - Unknown outcomes are resumed, not repeated. If there's no answer (a timeout, a 5xx, a malformed or oversized reply), retrying the same request resumes that operation with the same key for as long as the server keeps it: 24 hours, across restarts and key rotations for the same business. After that, the connector refuses to send it again and marks it
needs_reconciliation: check the record, then usecreate_another. - Repeats vs new sales. The same request repeated within 15 minutes of a success replays it. A deliberate second, identical record needs
create_another: true. - Replies are checked. Every reply is size-capped and schema-checked. A write's reply must match what was asked: amount, currency, text, reference, single-use, expiry, customer and totals, with URLs on a trusted origin. If it doesn't, the result is an error marked for reconciliation, never a success to share.
- Never authorization. A tool's annotations are hints for the client. What each key can do, and who may publish, is enforced on the server.
How it's built
The bundle is a thin client. Durable records, authorization, payment verification and audit belong to the backend. On testnet, payments are MerchantPay's on-chain records, read by the gateway. The sandbox stands in for the backend routes that don't exist yet, and API-CONTRACT.md is the contract it implements.
Security notes
- Stored text is data. Customer names, descriptions, memos and references are bounded and stripped of control, zero-width and bidi characters. They come back only as data, alongside a notice telling the model they are never instructions. They can't change a recipient, an amount, a scope or the tool set; the reminder's recipient is always the customer record's email.
- The model can't mark anything paid. Paid status comes only from verified payments: on testnet, the gateway's records; in the sandbox, signed events with a 5-minute window, applied once per event id, never moving a payment backwards. The payment simulator is a separate command that you run, not a tool.
- Publishing is the Owner's decision.
finalize_invoicecan only ask. The server binds the request to the invoice revision and its content hash, total, currency, customer and expiry. An Owner approves it once, and any edit cancels it. No tool approves, and no argument counts as approval (production review F4). - No money-moving tools. There is no tool that sends, pays, refunds, voids, transfers, signs, fetches URLs or changes keys, wallets, webhooks or settlement.
- Secrets stay out. The API key and the sandbox's signing secret are redacted from every result and stderr line. stdout carries only JSON-RPC, and the tests check this against the packaged archive.
- Money is exact. Amounts are integers in minor units: 2 decimals for fiat, 6 for USDT. Zero, negative, malformed and over-precise amounts are refused, and so is a decimal comma. Discounts and taxes are rounded half up, once each. Different currencies are never added together.
Not supported, and what production needs
Not built:
- customers, invoices, invoice numbers and PDFs, and reminders on the testnet backend (sandbox only);
- sending email or reminders;
- refunds, voids, partial payments or deposits beyond recording an underpayment, recurring invoices, CSV export through the connector, settlement reporting, disputes;
- a remote, OAuth-based server (planned as SRS FR-MCP-6/7);
- any rail other than USDT on Whitechain Testnet through the hosted checkout.
Before production (tracked in .batches/052-PW5-merchant-mcpb/production-plan.md):
- scoped, expiring, per-assistant credentials (Stage 2, on the Stage 3 workspace stack);
- customer and invoice tables with revisions, approvals, numbering and an audit trail on the backend (Stage 3);
- the Owner's authenticated review page, whose stand-in in the sandbox is the CLI;
- a durable payment-event ledger with reconciliation (Stage 4);
- distributed rate limits and cursor pagination;
- a signed, provenance-attested release from CI;
- mainnet contracts and their review;
- the business, legal and compliance gates in the Whiteflow plan.
Testnet mode needs the gateway routes from PR #48 (GET /api/v1/account, secret-key links, GET /api/v1/links/{id}, GET /api/v1/operations/{key}), owned by claude-contracts. Until those are deployed, testnet mode answers "This Whiteflow backend doesn't offer that yet."
Phase two (designed, not built)
- Reminder delivery, refunds, voids and settlement changes. The tool creates a proposal. The server binds it to the business, record version, amount and recipient, and returns a review URL. An authorized person approves it once, on an authenticated page. The server re-checks role, refundable amount and state before acting. A model-supplied
confirmed: trueis never approval. - Refunds. The remaining refundable amount is
paid − refunded, checked again at approval and at execution. - Partial payments and deposits. Invoices already record
amount_paidandamount_duefrom verified payments; allowing a partial state on purpose is an invoice-policy flag. - Recurring invoices. A schedule that creates drafts, which keep the same review step.
- Exports and settlement reconciliation. Based on the gateway's existing
reports.csvand settlements routes. - Disputes. A status on a payment, with evidence attached.
Development
The licence is MIT (repo LICENSE). The bundle's THIRD_PARTY_LICENSES lists every package bundled into it.
來源:packages/mcp/README.md,提交 5e1e2ad
工具
0版本歷史
1- v0.3.0最新Nov 7, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
