X402 Scan Mcp

io.github.forgemeshlabs由 GitHub 帳號 forgemeshlabs 發布v0.1.9更新於 Nov 3, 2026

x402 Endpoint Scanner — a free local health probe for x402 paid endpoints as an MCP server.

發布方自己的服務:scan.mx Email Diagnostics

概覽

AI 產生的概覽

本機 MCP 伺服器,用來探測 x402 付費端點並評級,判斷代理能否發現、解析並支付其 402 挑戰。

可以做什麼
  • 探測單一 x402 端點:HTTP 402 狀態、PAYMENT-REQUIRED 信封有效性、accepts[] 必填欄位、MPP 雙棧支援與免費內容外洩,並給出 A–F 評級與白話說明
  • 依序批次掃描最多 10 個 URL,輸出一行健康摘要並逐項回報錯誤
  • 取得 ForgeMesh 目錄統計以及 2026 年 8 月 x402 Bazaar 健康普查的主要數字
適用情境
適合在發布或維護 x402 付費 API 路由時,確認支援支付的代理能真正發現並付款;也適合在把一批端點收錄進代理目錄前先做檢查。
執行需求
需要 Node.js 20 或更新版本;以 stdio 在本機執行,通常透過 npx 啟動。未宣告任何 API 金鑰、帳號或環境變數。需要能連線到所掃描端點的網路,census_stats 另需連線 ForgeMesh 的公開統計端點。
安裝前請注意
它會對你提供的任何 URL 發出外部 HTTP 請求,因此只掃描可信任的主機;SSRF 防護會限制協定、連接埠以及私有與中繼資料位址,且不跟隨重新導向。它從不送出付款,也不提供 PAYMENT-SIGNATURE。README 指出若公開部署為 HTTP 服務,必須加上身分驗證、限流與對外連線政策。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

x402-scan-mcp — the free x402 Endpoint Scanner

Is your paid endpoint actually payable by agents?

Shipping a 402 Payment Required response is not the same as shipping a correct one. A missing field in accepts[], a malformed Base64 envelope, or content that leaks for free when the payment gate is misconfigured all look fine in a browser and invisibly cost you every agent that would have paid.

x402-scan-mcp is the free, open-source x402 Endpoint Scanner — an MCP server that probes one or more x402 endpoints and reports whether an agent can actually discover, parse, and pay for them. The npm package is @forgemeshlabs/x402-scan-mcp.

No payment is ever sent. The scanner never supplies a PAYMENT-SIGNATURE, so it cannot authorize or settle a transaction — it only inspects the shape of the 402 challenge.

=== x402 Endpoint Scan: https://library.forgemesh.io/business-management ===Reachable: true  HTTP: 402  Method: GET  (184ms)402: true  Envelope: header  Valid: true  MPP: trueGrade: AFindings:  - Valid x402 envelope is advertised over both the classic PAYMENT-REQUIRED header    and MPP's WWW-Authenticate: Payment header — maximally discoverable across agent    payment stacks.

What it checks

  • HTTP 402 status — does the route actually return 402 Payment Required, or does it 200/404/500 and go unnoticed by payment-aware agents?
  • PAYMENT-REQUIRED envelope — is the header present, Base64-decodable, valid JSON, with a numeric x402Version and a non-empty accepts[]? Falls back to checking the response body for an x402Version field on endpoints that put the envelope there instead.
  • Required payment fields — does every entry in accepts[] carry scheme, network, asset, payTo, and amount?
  • MPP dual-stack — is the endpoint also discoverable via the WWW-Authenticate: Payment header, the MPP discovery path some agent stacks use instead of the classic header?
  • Free-content leaks — does the route serve real content with a 200 when it should be gated behind 402?

Every result is graded A (valid envelope + MPP dual-stack), B (valid envelope, classic header only), C (402 but the envelope is missing or malformed), or F (not 402, unreachable, or serving paid content for free) — plus plain-English findings[] explaining what an agent sees and why it costs you traffic.

Install

Requires Node.js ≥ 20. Published on npm as @forgemeshlabs/x402-scan-mcp — no clone or build needed.

bash
npm install -g @forgemeshlabs/x402-scan-mcp

Or skip the install entirely and run it with npx (recommended for MCP clients):

bash
npx -y @forgemeshlabs/x402-scan-mcp

Claude Code

bash
claude mcp add x402-scan -- npx -y @forgemeshlabs/x402-scan-mcp

Claude Desktop / Cursor / Windsurf (any MCP client)

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

Development (from source)

Only needed if you're hacking on the scanner itself:

bash
git clone https://github.com/forgemeshlabs/x402-scan-mcpcd x402-scan-mcpnpm install && npm run buildclaude mcp add x402-scan -- node /path/to/x402-scan-mcp/dist/index.js

Tools

ToolWhat it does
scan_endpointProbe one x402 endpoint — HTTP status, envelope source/validity, accepts[] summary, MPP dual-stack, A-F grade, findings
scan_batchRun scan_endpoint over up to 10 URLs, sequentially, plus a one-line summary like 7/10 healthy, 2 dead, 1 broken envelope
census_statsLive ForgeMesh catalog stats plus the static August 2026 x402 Bazaar health census headline numbers

Try it: "Scan my x402 route for a valid 402 challenge" · "Batch-scan these 5 endpoints and tell me which ones are broken" · "What did the August 2026 x402 health census find?"

CLI smoke test (from a source checkout)

bash
npm run smoke -- https://your-endpoint.example.com

Beyond the free local scan

This MCP server is local-only and free: it never leaves your machine except to call the endpoint you point it at (and, for census_stats, ForgeMesh's own public stats endpoint). If you want more:

  • Hosted, paid, server-side scan — POST https://x402.forgemesh.io/x402-endpoint-scan, $0.05 via x402. Useful when you want the probe to originate from a different network than yours, or you're calling it from an agent that already pays x402 for other tools.
  • Browser tool — forgemesh.io/scan for a one-off scan with no MCP client or wallet needed.
  • $5 full report with fixes — a deeper audit with ready-to-paste fixes for every failing check, at forgemesh.io/scan.

The August 2026 x402 Bazaar health census

census_stats bundles the headline numbers from ForgeMesh's own sweep of the x402 Bazaar catalog: 1,225 sellers probed, 74% healthy, 206 dead, 40 serving paid content for free, and only 15% MPP dual-stack. Full writeup: forgemesh.io/blog/x402-bazaar-health-census-august-2026.

Security

This scanner makes outbound requests to URLs you give it, so it is built to resist SSRF abuse:

  • Scheme allow-list — only http/https; file:, ftp:, gopher:, data: etc. are rejected.
  • Port allow-list — only 80, 443, 8080, and 8443. Any other explicit port is refused before any DNS lookup or network call.
  • Local-hostname rejection — localhost, *.localhost, *.local, and *.internal are refused by name, before DNS resolution runs.
  • Private-target blocking — after DNS resolution, requests to loopback, private (RFC 1918), link-local, CGNAT, reserved, multicast, and the cloud metadata address (169.254.169.254) are refused. IPv6 loopback/ULA/link-local and IPv4-mapped forms are covered too. If a hostname resolves to any private address, the scan is refused.
  • Pinned-IP transport — the request dials the exact public IP that was validated, while TLS still verifies the original hostname. This closes the validate-then-connect DNS rebinding window.
  • No redirect following — a 3xx response is reported as-is (status + Location, if any); the scanner never chases it. This matches how a strict agent client behaves and keeps the request count predictable.
  • Bounded — at most 2 requests per scan_endpoint call (one GET, plus one POST retry only on 405), forgemesh-scan-mcp/0.1 UA, 8s timeout, 64KB body cap.
  • Tested hardening — npm test covers unsafe URL rejection, private IP ranges, port allow-listing, and endpoint-scan grading against a local fixture server.

Deployment: stdio (local, per-user) is the safe default. A public HTTP deployment is a network-egress tool and must add authentication, per-client rate limiting, request logging, and an egress policy before exposure.

License

MIT — free for everyone. If the scanner found a broken 402, the fix is usually a one-line envelope correction.

來源:README.md,提交 bd8604d

工具

3

scan_endpoint

Scan one x402 endpoint for a well-formed 402 challenge

Free, local, no-payment health probe for one x402 endpoint. GETs the URL (retries once as POST with {} on a 405), then checks: is the response HTTP 402; does it carry a valid PAYMENT-REQUIRED envelope (Base64 JSON with numeric x402Version and a non-empty accepts[] where every entry has scheme/network/asset/payTo/amount), falling back to checking the body for an x402Version field; and does it also advertise MPP dual-stack via WWW-Authenticate: Payment. Grades A (valid envelope + MPP dual-stack), B (valid envelope only), C (402 but the envelope is missing or malformed), or F (not 402, unreachable, or serving paid content for free). Never sends a PAYMENT-SIGNATURE and cannot spend funds — this only inspects the challenge shape. Refuses non-http(s) URLs, localhost/.internal/.local hosts, private/reserved IPs, and ports outside 80/443/8080/8443; never follows redirects; caps the response body at 64KB; makes at most 2 requests.

輸入參數url必填

scan_batch

Scan up to 10 x402 endpoints at once

Runs scan_endpoint sequentially over a list of URLs (max 10) and returns each full result plus a one-line summary, e.g. '7/10 healthy, 2 dead, 1 broken envelope'. One bad URL never aborts the batch — its error is reported per-item instead. Same no-spend, SSRF-guarded probe as scan_endpoint applied to every URL.

輸入參數urls必填

census_stats

x402 Bazaar health census stats

Fetches the latest ForgeMesh catalog stats (best-effort, 5s timeout, no input required) alongside the static headline numbers from the August 2026 x402 Bazaar health census: 1,225 sellers probed, 74% healthy, 206 dead, 40 serving paid content for free, and 15% MPP dual-stack. Source: https://forgemesh.io/blog/x402-bazaar-health-census-august-2026

無需輸入參數。

版本歷史

4
  1. v0.1.9最新Nov 3, 2026
  2. v0.1.8Oct 25, 2026
  3. v0.1.5Oct 8, 2026
  4. v0.1.2Sep 16, 2026

評分

已滿足適用檢查項的 90%

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

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

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

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Scan 整合