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 集成