x402 Conformance

io.github.atsp-protocol由 GitHub 帳號 atsp-protocol 發布v1.6.0更新於 Oct 25, 2026

x402 payment safety checks: validate a 402 answer, prove a server never serves before settlement.

概覽

AI 產生的概覽

一個執行 x402 付款一致性檢查的 MCP 伺服器,可驗證付費端點的 402 回應,並證明伺服器在結算前不會送出內容。

可以做什麼
對某個付費 URL 發出一次未付款的 GET 請求,依 P1-P7 檢查其 402 回應。針對內建示範伺服器執行完整的 P1-P7 與 R0-R10 檢查,可選擇注入故障。在回環位址上啟動與停止本機 facilitator 替身,供自己的資源伺服器指向。在回環位址上探測資源伺服器,檢查逾時仍送出內容、回應損壞、settlement_pending、失敗或重複等結算順序問題。說明某個檢查 ID 測什麼以及失敗後如何修正。依報告產生匿名化的語料案例與預填的 issue 連結,但不送出任何內容。
適用情境
適用於開發或審查 x402 付費 API 時,讓助理在上線前驗證 payment-required 回應與結算順序。適合本機開發以及針對回環伺服器的測試,而非正式流量。
執行需求
透過 stdio 在本機執行,可用 npx 執行 npm 套件,或使用 Docker 映像。未宣告任何帳號、API 金鑰或環境變數。探測與 facilitator 替身工具需要回環位址以及正在執行的本機資源伺服器。選用的 AI SDK 與 LangChain 轉接器需另行安裝其 peer 相依套件。
安裝前請注意
檢查工具會對所給的 URL 發出未付款的 GET 請求,因此只應指向你有權存取的端點。探測與替身工具僅供回環位址與本機測試使用。分享案例只會產生匿名化報告與連結,不會送出內容,由使用者自行審閱並提交。報告會在報告內容與 User-Agent 中記錄產生它的進入點。此伺服器聲明從不付款、簽章或接觸主網。

安裝

在 SourceWeft 中

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

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

x402-conformance-mcp

x402 conformance and safety checks as tools, for MCP clients (Claude, Cursor, VS Code, Windsurf and others), the Vercel AI SDK and LangChain. It's a thin entry point into the open x402-conformance suite: the same checks and check IDs as the CLI, the GitHub Action and the test matchers, and the full x402-conformance.report/1 report. It never pays, signs or touches mainnet.

MCP

json
{ "mcpServers": { "x402-conformance": { "command": "npx", "args": ["-y", "x402-conformance-mcp"] } } }

The same server runs from the Docker image, which starts it on stdio when given no arguments: { "mcpServers": { "x402-conformance": { "command": "docker", "args": ["run", "-i", "--rm", "ghcr.io/atsp-protocol/x402-conformance:1"] } } }. npx -y x402-conformance-mcp --version prints the version, and --help prints the client config and a link to docs/USING.md.

toolargumentswhat it does
x402_check_payment_requiredurl, http or httpsone unpaid GET to a paid URL; checks its 402 answer (P1-P7)
x402_demofault, optional: none or serve_on_any_settleP1-P7 and R0-R10 against a built-in demo server, no wallet or setup; fault: serve_on_any_settle shows a failure
x402_start_facilitator_doubleport, optional; 0 or omitted picks a free onestarts the facilitator double on loopback; point your server at its URL
x402_probe_resource_serverresource_url on loopback; network, optional: auto, solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1 or eip155:84532R0-R10 against your server on loopback: no content on a timeout, a broken answer, settlement_pending, a failure or a duplicate. Start the double first
x402_stop_facilitator_doublenonestops the double
x402_explain_checkid, for example R3, P5 or R11awhat a check tests and how to fix a failure, from docs/FIXES.md
x402_share_casereport from another x402 tool; optional framework, sdk, sdk_version, networkan anonymised corpus case and a pre-filled issue link; nothing is sent, the user decides

Try asking: "Run the x402 demo", "Check the 402 answer at http://127.0.0.1:4020/paid", or "Start the facilitator double, I'll point my server at it, then probe http://127.0.0.1:4020/paid".

Vercel AI SDK

ts
import { generateText } from "ai";import { x402ConformanceTools } from "x402-conformance-mcp/ai-sdk";
await generateText({ model, tools: x402ConformanceTools(), prompt: "Is the 402 answer at https://api.example.com/paid valid x402?" });

LangChain and LangGraph

ts
import { createReactAgent } from "@langchain/langgraph/prebuilt";import { x402ConformanceTools } from "x402-conformance-mcp/langchain";
const agent = createReactAgent({ llm, tools: x402ConformanceTools() });

The AI SDK and LangChain adapters give an agent the four read-only tools (check, demo, explain, share). The double and probe tools stay in MCP, where a person is driving. The adapters need ai 5.0.0 or later, or @langchain/core 0.3.0 or later, installed next to them; both are optional peer dependencies.

The corpus

A failing report can become an anonymised case in the public corpus of real x402 failures. x402_share_case prepares it and returns the link; the user reviews it and submits it, or doesn't. Every report names the entry point that produced it (via: mcp, ai-sdk or langchain) in the report and the User-Agent; there's no other identifier and no telemetry.

Apache-2.0. Ryan Gillespie / Optitransfer.

來源:ts/mcp/README.md,提交 91c533e

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:軟體包安裝失敗。

版本歷史

3
  1. v1.6.0最新Oct 25, 2026
  2. v1.5.0Oct 24, 2026
  3. v1.4.0Oct 23, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分