Universal MCP Gateway

agent402 is the paid gateway layer between LLM agents and useful external tools. Human mode is product-level: what it gives, where to plug it, and what to monitor.

agent402 is a machine-first MCP endpoint with x402 billing. Agent mode is protocol-level: discovery order, request flow, and 402 recovery behavior.

Single Gateway

One MCP surface for multiple paid tools. You can ship one integration and expand tool coverage without client rewrites.

Usage-Based Spend

Per-tool pricing is explicit in discovery, so both humans and agents can reason about cost before invoking tools.

Machine Discoverable

Canonical paths are stable and public: /mcp, /.well-known/mcp.json, and /x402/discovery.

Discovery First

Resolve server card from /.well-known/mcp.json, then resolve capabilities and prices from /x402/discovery.

MCP Lifecycle

Connect to /mcp and execute initialize -> tools/list -> tools/call.

402-Aware Calls

On paid calls, handle 402 Payment Required, settle x402, and retry with proof without changing arguments.

Why Teams Use It

Human mode is optimized for product and infra decisions. Think of this as the “what does this gateway buy us?” view.

  1. Unified MCP entrypoint instead of per-tool custom contracts.
  2. Explicit billing semantics (x402) for paid tool operations.
  3. Agent + human discovery compatibility out of the box.
  4. Stable URLs that can be indexed by docs tools and bots.

Human Integration Flow

  1. GET /.well-known/mcp.json to discover canonical metadata.
  2. GET /x402/discovery for tool list, schemas, and pricing.
  3. Use /mcp as MCP transport endpoint.
  4. On 402 Payment Required, complete payment and retry with proof.
curl -sS https://agent402.dev/.well-known/mcp.json
curl -sS https://agent402.dev/x402/discovery
curl -sS https://agent402.dev/health
Core Agent Paths

For robust clients, always keep these three paths cached and refreshed: /mcp, /.well-known/mcp.json, /x402/discovery.

Key Endpoints

MCP Transporthttps://agent402.dev/mcp
MCP Cardhttps://agent402.dev/.well-known/mcp.json
x402 Discoveryhttps://agent402.dev/x402/discovery

Endpoint Reference

Path Methods Purpose URL
/mcp POST, GET, DELETE Primary Streamable HTTP MCP transport. https://agent402.dev/mcp
/.well-known/mcp.json GET Canonical MCP server card for discovery. https://agent402.dev/.well-known/mcp.json
/server.json GET MCP Registry-compatible metadata document. https://agent402.dev/server.json
/x402/discovery GET Price + capability discovery for paid tools. https://agent402.dev/x402/discovery
/meta.json GET Machine-friendly site metadata and endpoint map. https://agent402.dev/meta.json
/metrics GET Operational and business metrics snapshot. https://agent402.dev/metrics
/pmf/scorecard GET Weekly PMF adoption scorecard (paid usage validation). https://agent402.dev/pmf/scorecard

Tool Catalog

openrouter-chat

LLM inference and chat completion via OpenRouter. Pay-per-use, no API key needed. Supports GPT-4o, Claude, and 200+ models.

$0.005 per call

brave-search

Web search via Brave Search API. Pay-per-use, no API key needed. Fast internet search for AI agents.

$0.002 per call