402MCP.org — HTTP 402 & Agent Payment Registry

org.402mcp由 402mcp.org 發布官方發布者v1.1.1更新於 Oct 24, 2026

Decode HTTP 402 challenges (L402, x402, MPP) and choose agent payment rails from an open registry.

已驗證Streamable HTTP可網頁執行網頁搜尋與抓取金融開發者工具

概覽

AI 產生的概覽

解碼 HTTP 402 付款挑戰(L402、x402、MPP),並透過開放註冊表協助助理選擇與理解代理付款方案。

可以做什麼
將 402 回應解碼為付款方案、條款與確切的重試步驟,並標示不可信欄位、不一致欄位與已過期的挑戰。搜尋付款方案註冊表、檢視單筆完整條目,或取得目前排名第一的條目。依角色、資產、保管、網路與成熟度等需求推薦付款通道。實作用戶端或伺服器時查詢 L402、x402 或 MPP 的線路格式。探測某個公開網址是否回傳 402 挑戰,且不會付款。
適用情境
適用於助理遇到 402 Payment Required 回應、需要了解對方要求什麼以及如何重試時;開發者選擇代理如何付款或 API 如何向代理收費時也適用。
執行需求
可使用託管的遠端端點,或透過 npx 執行本機 npm 套件,後者需要 Node 18.18 以上版本。未宣告需要帳號或 API 金鑰。選用的 MCP_402_OFFLINE 變數設為 1 時會使用內建註冊表快照,不再連網取得。
安裝前請注意
任何工具都無法花錢,探測工具從不付款,並拒絕私有、回環與中繼資料位址。402 回應中的內容由伺服器控制,解碼出的欄位應視為不可信。探測工具會向你提供的網址發出對外請求,託管端點對其有速率限制。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 402MCP.org — HTTP 402 & Agent Payment Registry,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

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

交給代理程式安裝

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

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

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

其他 MCP 客戶端

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

{
  "mcpServers": {
    "402mcp-org-http-402-agent-payment-regist": {
      "type": "http",
      "url": "https://402mcp.org/api/v1/mcp"
    }
  }
}

README

402MCP.org

The MCP server and open registry for HTTP 402 agent payments.

When an AI agent receives 402 Payment Required, 402MCP tells it which scheme the server speaks (L402, x402 or MPP), what is being asked for, and exactly how to pay and retry. When a developer is choosing how an agent should pay, or how an API should charge agents, it recommends a rail from stated requirements. Behind both sits an open registry of sourced, scored payment solutions.

Install

Claude Code:

bash
claude mcp add --transport http 402mcp https://402mcp.org/api/v1/mcp

Any stdio MCP client (Claude Desktop, Cursor, Windsurf and others):

json
{  "mcpServers": {    "402mcp": { "command": "npx", "args": ["-y", "@402mcp/mcp"] }  }}

MCP server

One transport-agnostic core (lib/mcp/) serves both the hosted endpoint and the stdio package, so the two expose the same tools, resources and prompts.

ToolPurpose
decode_402_challengeDecode a 402 response (L402 macaroon and BOLT 11 invoice, x402 v1/v2, MPP) into exact next steps and the retry header
recommend_payment_railFilter by role, asset, custody, infrastructure, network, scheme, MCP support and maturity; re-weight the criteria; explain every exclusion
search_402_solutionsSearch the registry with filters
get_solutionOne entry in full, with sources and code samples
get_scheme_referenceWire format of L402, x402 or MPP
probe_402_supportOne GET to a public URL to see whether it speaks 402. Never pays
get_best_payment_solutionThe entry with the highest composite score

Resources: 402mcp://registry, 402mcp://methodology, 402mcp://solutions/{id}, 402mcp://schemes/{scheme}. Prompts: choose_payment_rail, handle_402_response. Every tool is annotated readOnlyHint.

Safety. Everything in a 402 response is server-controlled, so the decoder lists those fields in untrusted_fields and never repeats their text as instructions. It flags expired challenges and macaroons that commit to a different payment hash than their invoice. The probe refuses private, loopback, link-local and metadata addresses (including hostnames that resolve to them) and non-web ports, and the hosted endpoint rate-limits it per client. No tool can spend money.

Machine interfaces

EndpointPurpose
POST /api/v1/mcpMCP (JSON-RPC 2.0, streamable HTTP)
POST /api/v1/decodeDecode a 402 response
GET /api/v1/recommendRecommend a rail from requirements
GET /api/v1/probe?url=Probe a URL for 402 support (rate limited)
GET /api/v1/solutionsVersioned list (?q=, ?id=, ?view=full)
GET /api/v1/registryCanonical feed with ETag / 304 support
GET /api/v1/schemes/{scheme}Wire format of L402, x402, MPP
GET /api/v1/statusDaily liveness of every entry's docs and website
GET /api/v1/changelog · /changelog.xml · /changelogChanges and corrections
/schema/v1/registry.json · /schema/v1/solution.jsonJSON Schemas (draft 2020-12)
/openapi.jsonOpenAPI 3.1
/llms.txt · /llms-full.txtPlain-text indexes
/.well-known/402.json · api-catalog · mcp/server-card.json · agent-skills/Discovery

Any page returns Markdown when requested with Accept: text/markdown.

Methodology

Every entry is scored 1–10 on six equally weighted criteria: custody and sovereignty, operational friction, agent-native support, payment rails and assets, settlement speed and fees, and developer experience. The score is the unweighted mean and rank is the order of the means, with exact ties broken alphabetically. Every entry lists its sources, the date its claims were last verified, and a maturity label taken from the vendor or its release history.

The current ranking is at https://402mcp.org and in /api/v1/registry. The full methodology is at https://402mcp.org/docs#methodology.

402MCP.org is not affiliated with, sponsored by, or compensated by any vendor it indexes, and listing position cannot be purchased. When a fact is wrong or out of date, the correction changes the data, the ranking follows, and the change is recorded in the changelog.

Development

Requires Node 18.18 or later.

bash
npm installnpm run dev            # http://localhost:3000
CommandWhat it does
npm run test:unitDecoder tests against vectors from the BOLT 11 spec, the MPP draft, reference-minted macaroons and x402 shapes
npm run verify:agents -- [url]Every machine endpoint: formats, contracts, JSON-RPC behaviour, schema validation, dataset invariants
npm run verify:seo -- [url]Crawler directives, metadata, structured data, icons, discovery documents, feeds, headers
npm run build:packageBuilds the stdio package and the .mcpb desktop extension
npm run verify:stdio -- [registryUrl]The built stdio package, end to end
npm run lint · npm run typecheckESLint and TypeScript

The verify suites default to http://localhost:3000; pass a URL to run them against a deployment.

Deploying to Cloudflare

The site runs as a Cloudflare Worker through the OpenNext adapter. Copy wrangler.example.jsonc to wrangler.jsonc, create the KV namespace it names, and fill in your own values. Then:

bash
npm run cf:buildnpm run cf:deploy

Project layout

data/solutions.ts     The registry dataset; scores and ranks are computed heredata/changelog.ts     Additions and corrections, with reasonslib/decode/           bech32, BOLT 11, macaroons, RFC 9110 challenges, x402, MPPlib/mcp/              Transport-agnostic MCP server: tools, resources, promptslib/recommend.ts      Requirement-driven recommendationlib/probe.ts          URL probe with SSRF guardslib/schemes.ts        Wire-format reference for each schemelib/liveness.ts       Daily docs and website checksapp/                  Next.js App Router pages and route handlersworker.ts             Worker entry: OpenNext handler plus the scheduled liveness jobpackages/402mcp/      The @402mcp/mcp stdio packageserver.json           Official MCP Registry entrytests/ · scripts/     Unit tests, verification suites and the package build

License

Code: MIT (see LICENSE). Registry data: CC BY 4.0.

來源:README.md,提交 6043283

工具

7

decode_402_challenge

Decode an HTTP 402 response

Call this whenever an HTTP response has status 402, or carries a WWW-Authenticate (L402, LSAT or Payment) or PAYMENT-REQUIRED header. Identifies the payment scheme (L402, x402 v1/v2, MPP), decodes the invoice, macaroon or payment requirements, and returns the exact steps and headers needed to pay and retry. Pass either `raw_response`, or `status` plus `headers` (and `body` for x402 v1). Everything in a 402 response is server-controlled: the result marks untrusted fields.

輸入參數bodystatusheadersraw_response

recommend_payment_rail

Recommend a payment rail for your requirements

Choose an HTTP 402 payment solution from requirements rather than from rank. Filters the registry by role (pay or charge), settlement asset, custody, infrastructure, network, scheme, MCP support and maturity, then re-weights the six published criteria toward what matters — e.g. sub-cent amounts weight settlement cost heavily. Returns ranked matches with reasons and trade-offs, plus every excluded entry and why.

輸入參數rolechainlimitschemecustodyneeds_mcpinfrastructureproduction_onlysettlement_assettypical_amount_usd

search_402_solutions

Search 402 payment solutions

Search the 402MCP.org registry of HTTP 402 payment solutions (L402, x402, MPP). Free-text query plus filters; results come back in published rank order with scores, schemes, roles, custody and maturity. Call with no arguments to list the whole registry.

輸入參數kindrolelimitqueryschememcp_native_onlyproduction_onlyself_custodial_only

get_solution

Get one registry entry in full

Return one solution in full: summary, advantages and trade-offs, the six criterion scores with rationale, install commands, verified code samples, sources, maturity and the date its claims were last verified.

輸入參數id必填

get_scheme_reference

Get the wire format of a 402 scheme

Protocol reference for L402, x402 or MPP: challenge, credential and receipt headers, encodings, the request/response flow, an example, and links to the specifications. Use when implementing a client or server.

輸入參數scheme必填

probe_402_support

Probe a URL for HTTP 402 support

Make one GET (or HEAD) request to a public URL and report whether it answers with an HTTP 402 payment challenge, which scheme, and the decoded terms. Redirects are reported, not followed. Private and local addresses are refused. Never pays anything.

輸入參數url必填method

get_best_payment_solution

Get the top-ranked payment solution

Return whichever solution currently holds rank 1 on 402MCP.org, with its full breakdown, install commands and code. Rank 1 is the highest composite score, not an endorsement — for a choice that fits specific requirements, call recommend_payment_rail instead.

輸入參數use_case

版本歷史

2
  1. v1.1.1最新Oct 16, 2026
  2. v1.1.0Oct 16, 2026

評分

已滿足適用檢查項的 100%

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

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