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 分