x402 Doctor

com.twelvepermissions由 twelvepermissions.com 發布v1.0.0更新於 Oct 24, 2026

Diagnose x402 seller endpoints: what is wrong with your 402 challenge, and how to fix it.

發布方自己的服務:Twelve Permissions

已驗證Streamable HTTP可網頁執行開發者工具安全與監控

概覽

AI 產生的概覽

一個免費的遠端診斷工具,用來探測 x402 賣方端點,回報其 402 付款挑戰的問題並提供修正建議。

可以做什麼
探測付費 x402 端點:模擬付費用戶端進行握手,依 16 條規則檢查 402 挑戰,回傳 healthy、advisories、defects_found、not_x402 或 unreachable 等狀態,以及每項發現的證據與來源(規格或觀察到的 facilitator 拒絕)。依 id 說明單一規則:檢查內容、重要性、修正方式及其來源。列出完整規則表,包含未檢查的項目,以便正確解讀乾淨的結果。
適用情境
當你營運付費 x402 賣方端點、付款無法結算或挑戰看起來有問題,並希望在不經過 facilitator 的情況下做賣方端診斷時使用。也適合在發布端點前檢視規則集。
執行需求
使用託管服務的遠端 Streamable HTTP 端點;未宣告帳號、API 金鑰或標頭。服務需能透過網路存取目標 URL。限速為每個 IP 每小時 20 次請求、整體每小時 300 次。
安裝前請注意
此服務會抓取任意給定的 URL,因此只探測你有權測試的端點;重新導向最多跟隨 3 層,每一跳都會重新執行 SSRF 防護。它從不送出付款,也從不索取金鑰、助記詞或錢包。它不透過 facilitator 驗證,因此結論僅來自回傳的挑戰。會儲存每個 IP 的請求計數最多兩小時;探測目標不會被記錄。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 x402 Doctor,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/com.twelvepermissions%2Fx402-doctor/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "x402-doctor": {
      "type": "http",
      "url": "https://x402-doctor.tsharpe.workers.dev/mcp"
    }
  }
}

README

x402 Doctor

A free diagnostic for x402 seller endpoints. Point it at your paid endpoint and it performs the handshake a paying client would — a GET with no X-PAYMENT header — then reports what is wrong with the 402 challenge you answered with, and what to change.

Live: https://x402-doctor.tsharpe.workers.dev

bash
curl -s -X POST https://x402-doctor.tsharpe.workers.dev/probe \  -H 'Content-Type: application/json' \  -d '{"url":"https://your-service.example/paid-endpoint"}'

Why seller-side

Buyer-side x402 is well served by the official SDKs. Seller-side is where people get stuck, because the failure happens inside a facilitator you cannot see into: your endpoint looks fine, the payment does not settle, and the error surfaces somewhere you do not control.

Every check carries a provenance field, so no finding has to be taken on trust:

  • spec — the x402 specification requires it.
  • observed (source) — we watched a real facilitator reject it, and the source is named.

What you get back

json
{  "target": "https://your-service.example/paid-endpoint",  "finalUrl": "https://your-service.example/paid-endpoint",  "status": "advisories",  "http": { "status": 402, "contentType": "application/json" },  "findings": [    {      "id": "challenge-cacheable",      "severity": "warn",      "title": "402 challenge is cacheable",      "why": "…",      "fix": "…",      "provenance": "observed (ours, 2026-08-15)",      "evidence": "cache-control: public, max-age=300"    }  ],  "checksRun": 16,  "bodyTruncated": false,  "bodyChecksSkipped": 0,  "bodySkipReason": null}

status is one of:

statusmeaning
healthynothing to report
advisoriesnotes worth reading, but no errors
defects_foundat least one error
not_x402the endpoint did not answer with an x402 challenge
unreachablethe probe could not complete — see reason

If the body was truncated or unparseable, body checks are skipped and the report says so (bodyChecksSkipped, bodySkipReason). A check that did not run is never reported as a check that passed.

The 16 checks

idseveritycheckprovenance
no-402errorEndpoint did not answer 402 without paymentspec
body-not-jsonerror402 body is not parseable JSONspec
oversized-bodywarn402 body exceeded the read capobserved (this probe)
missing-x402-versionerrorx402Version is absent or not 1spec
accepts-emptyerroraccepts is missing, not an array, or emptyspec
output-schema-nullerroroutputSchema is explicitly nullobserved (Coinbase CDP facilitator, 2026-07-17)
amount-not-atomic-stringerrormaxAmountRequired is not an atomic-unit stringspec
asset-network-mismatchwarnasset is not the USDC contract for this networkspec
missing-eip712-extraerrorscheme "exact" without the EIP-712 domain in extraspec
unknown-network-nameinfonetwork name is not one this probe recognisesspec
payto-not-an-addresserrorpayTo is not a valid address for this networkspec
payto-not-checksummedinfopayTo is not a checksummed addressspec
no-timeout-declaredinfomaxTimeoutSeconds is absentspec
challenge-cacheablewarn402 challenge is cacheableobserved (ours, 2026-08-15)
cors-headers-not-exposedinfobrowser clients will need payment headers exposed on the settlement responseobserved (x402-foundation/x402#2112)
bazaar-ext-inside-acceptswarnBazaar extension declared inside an accepts entryobserved (ours, 2026-08-14)

Also an MCP server

POST /mcp, stateless Streamable HTTP. Three tools:

toolwhat it does
probe_x402_endpointrun the diagnostic against a URL
explain_defectfull explanation of one check by id
list_checksthe whole rule table with provenance

What it deliberately does not do

  • It never validates through a facilitator. Doing so would route your traffic through someone else's facilitator credentials. Every check here is derived from the challenge you actually returned.
  • It never sends a payment, and never asks for a key, a seed, or a wallet.
  • It does not judge networks it does not know. An unrecognised network name is an info note about the limits of this probe's list — not a claim that your network is wrong. Address-format rules apply only where the address format is known.

Limits worth knowing

  • The body is read to a cap; past that, body checks are skipped and the report says so rather than guessing.
  • Redirects are followed to a depth of 3, with the SSRF guard re-run on every hop.
  • Rate limited to 20 requests/hour per IP and 300/hour overall, because the service fetches whatever URL it is given.
  • The only thing stored is a per-IP request counter for that rate limit, which expires within two hours. No analytics, and probe targets are never logged.

Security posture, and the residual risks that were accepted rather than fixed, are documented in SECURITY.md.

Reading and running the source

bash
cd doctornpm test          # 163 tests, no dependencies of any kind

Zero dependencies, runtime or dev — the suite is node --test. The rules are pure functions with no I/O; all network access lives in src/probe.js, which is also where the SSRF guard lives.

The hosted service above is free to use and needs no licence. The source is published for inspection and verification under the same terms as the rest of this repository: no licence granted at this time, all rights reserved. If you want to reuse or self-host it, ask.


Built by Twelve Permissions. Free, and unrelated to anything sold there.

來源:doctor/README.md,提交 20ce551

工具

3

probe_x402_endpoint

Probe an x402 seller endpoint and report what it observes about it. Performs the handshake a paying client would: GET with no X-PAYMENT header, then checks the 402 challenge against 16 rules. Every finding says whether the rule comes from the x402 spec or from an observed facilitator rejection. Reports status "healthy" (nothing to report), "advisories" (only warn/info findings — the endpoint works), "defects_found" (at least one error-severity finding), "not_x402" or "unreachable".

輸入參數url必填

explain_defect

Full explanation of one rule by id — what it checks, why it matters, how to fix it, and where the rule came from. Use when you want the reasoning without re-probing.

輸入參數id必填

list_checks

The whole rule table. Knowing what was NOT checked is part of knowing what a clean result means.

無需輸入參數。

版本歷史

1
  1. v1.0.0最新Sep 16, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。

其他 Twelvepermissions 整合