x402 Router

io.github.camerxnduffPublished by GitHub account camerxnduffv0.1.0Updated Nov 1, 2026

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

The publisher's own server: 370.ai — AI Gateway: 100+ Chat Models, Image & Speech Generation

Overview

AI-generated overview

Read-only MCP server that searches a probed registry of live x402 pay-per-call endpoints and routes an agent to the best-scored one.

What you can do
  • Search the live x402 endpoint registry by query, chain, category, price and score
  • Route a request to the best-scored endpoint, with a free top-3 preview
  • Read registry statistics and counts by chain, category and source
  • Retrieve the payment requirements for a paid route
  • Optionally, with a funded wallet configured, run paid tools that return a full ranked list or a fresh live probe of one endpoint
When to use it
Useful when an agent needs to call x402 pay-per-call APIs and you want it to pick a working, reasonably priced endpoint instead of guessing among thousands of often dead or misconfigured ones.
Requirements
Runs locally over stdio, via uvx, Docker or a Python source install; it calls a hosted router service, so network access is needed. Optional environment variables X402_ROUTER_URL and X402_DASHBOARD_URL override the service URLs. Paid tools additionally need the pay extra, X402_EVM_PRIVATE_KEY and optionally X402_MAX_PAYMENT_USD.
Before you install
The free tools are read-only and hold no keys, but the paid tools spend USDC from the wallet given in X402_EVM_PRIVATE_KEY, so use a dedicated low-balance wallet and keep the per-call cap low. Without a key those tools only return payment requirements. Queries and endpoint data are sent to the hosted router service.

Installation

In SourceWeft

  1. Open x402 Router in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

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

Source: README.md at commit e0f015b

Tools

0
SourceWeft started this package once in an isolated sandbox, without credentials, to list its tools. That failed: the package type cannot run in the sandbox.

Version history

1
  1. v0.1.0LatestOct 25, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

Other Router integrations