x402 Router

io.github.camerxnduff由 GitHub 帳號 camerxnduff 發布v0.1.0更新於 Nov 1, 2026

Search 20k+ live, probed x402 pay-per-call endpoints and route to the best-scored one.

發布方自己的服務:370.ai — AI Gateway: 100+ Chat Models, Image & Speech Generation

概覽

AI 產生的概覽

唯讀 MCP 伺服器,可搜尋經探測的 x402 按次付費端點登錄檔,並為助理路由到評分最高的端點。

可以做什麼
  • 依關鍵字、鏈、類別、價格與評分搜尋即時 x402 端點登錄檔
  • 將請求路由到評分最高的端點,並免費回傳前三名預覽
  • 讀取登錄檔統計資料,以及依鏈、類別與來源的計數
  • 取得付費路由的付款需求
  • 在已設定錢包的情況下,可選用付費工具取得完整排名清單或對單一端點做即時探測
適用情境
當助理需要呼叫 x402 按次付費 API,並希望從數千個經常失效或設定錯誤的端點中挑選一個可用且價格合理的端點時適用。
執行需求
透過 uvx、Docker 或 Python 原始碼在本機以 stdio 執行;需要連線到託管的 router 服務,因此需要網路。可選環境變數 X402_ROUTER_URL 與 X402_DASHBOARD_URL 可覆寫服務位址。付費工具另需安裝 pay 附加元件並提供 X402_EVM_PRIVATE_KEY,可選 X402_MAX_PAYMENT_USD。
安裝前請注意
免費工具為唯讀且不持有金鑰,但付費工具會從 X402_EVM_PRIVATE_KEY 指定的錢包花費 USDC,建議使用專用的低餘額錢包並維持較低的每次呼叫上限。未提供金鑰時這些工具只回傳付款需求。查詢內容與端點資料會傳送到託管的 router 服務。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

x402 Router: MCP server + free API to find and pay the right x402 endpoint

[MCP] [x402] [Chains] [USDC] [License: MIT] [Docker build]

20,700+ LIVE x402 pay-per-call endpoints across 3,100+ services, probed every 3 hours and scored 0-100 for reliability. Agents don't need to know which x402 API is up. Ask the router.

Keywords: x402, MCP, MCP server, AI agents, agent payments, pay-per-call APIs, USDC, Base, Solana, x402 discovery, x402 router, x402 registry, HTTP 402.

Quick start (MCP, 30 seconds)

The server is read-only: it holds no keys and never pays. It exposes four tools: search_x402_endpoints, route_x402_request, get_registry_stats, get_paid_route_requirements.

Option A: uvx (no clone, no PyPI needed)

Claude Desktop (claude_desktop_config.json) or Cursor (~/.cursor/mcp.json):

json
{  "mcpServers": {    "x402-router": {      "command": "uvx",      "args": ["--from", "git+https://github.com/camerxnduff/x402-router-mcp#subdirectory=mcp-server", "x402-router-mcp"]    }  }}

Option B: Docker

json
{  "mcpServers": {    "x402-router": {      "command": "docker",      "args": ["run", "-i", "--rm", "ghcr.io/camerxnduff/x402-router-mcp:latest"]    }  }}

Or build it yourself: docker build -t x402-router-mcp . and use x402-router-mcp as the image name.

Option C: from source

bash
git clone https://github.com/camerxnduff/x402-router-mcpcd x402-router-mcp/mcp-serverpython3 -m venv .venv && . .venv/bin/activatepip install -r requirements.txtpython test_client.py   # calls the live router, read-only
json
{"mcpServers":{"x402-router":{"command":"/abs/path/x402-router-mcp/mcp-server/.venv/bin/python","args":["/abs/path/x402-router-mcp/mcp-server/server.py"]}}}

Streamable HTTP: python server.py --http 8000 serves http://localhost:8000/mcp. Env overrides: X402_ROUTER_URL, X402_DASHBOARD_URL.

Try it with no install (curl)

bash
# best live Base endpoint for a category (free preview)curl -s -X POST https://router-production-ab89.up.railway.app/route \  -H 'content-type: application/json' -d '{"category":"Finance","chain":"Base"}'
# search the registrycurl -s 'https://router-production-ab89.up.railway.app/dashboardapi/endpoints?q=weather&chain=Base&limit=5'

Why

Thousands of x402 endpoints exist, and many are dead, misconfigured or slow. The router probes every one, checks that its 402 body is valid (version, scheme, network, payTo, asset, amount), and ranks by uptime and latency, so an agent gets a working endpoint with a known price.

HTTP API

EndpointWhat
GET /api/endpoints?q=&chain=&category=&max_price=&min_score=&sort=&limit= (dashboard)Search LIVE endpoints, best first
GET /api/summary (dashboard)Counts by chain, category, source
GET /api/registry (dashboard)Full registry (gzip)
POST /route (router)Best match + top 3, free
POST /route/paid (router)$0.01 USDC (x402, Base; Solana accepted): full ranked list (up to 25) with latency, reliability, price, payTo/networks and a ready-to-pay best pick
GET /check/paid?url= (router)$0.002 USDC (x402): fresh live probe of one endpoint: is it up, latency, the real price and payTo it asks for now

Examples: examples/ (curl, Python, TypeScript).

MCP tools

ToolCost
search_x402_endpoints, route_x402_request, get_registry_stats, get_paid_route_requirementsFree
find_best_x402_endpoint$0.01 USDC per call
check_x402_endpoint$0.002 USDC per call

Paid tools pay inside the tool call. To enable them:

bash
pip install "x402-router-mcp[pay] @ git+https://github.com/camerxnduff/x402-router-mcp#subdirectory=mcp-server"export X402_EVM_PRIVATE_KEY=0x...      # a dedicated, low-balance Base wallet holding a little USDCexport X402_MAX_PAYMENT_USD=0.01       # per-call cap (default 0.01)

Without a key, the paid tools return the price and the x402 payment requirements instead of paying.

Payments

x402 v2: Base USDC first, Solana USDC as fallback, settled through the PayAI facilitator.

License

MIT

來源:README.md,提交 e0f015b

工具

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

版本歷史

1
  1. v0.1.0最新Oct 25, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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

其他 Router 整合