x402-mcp is an MCP server whose goal is to connect a large number of APIs paid for via the x402 protocol to AI agents. It supports Claude, Cursor, and any client that can recognize MCP.
Purpose and positioning: This server is aimed at agentic commerce scenarios, such as developer tools, validators, encoders, generators, machine-to-machine payments, and autonomous workflows. It lets AI agents directly call pay-per-use APIs while performing tasks.
Main capabilities:
- Automatically discover x402 endpoints from CDP Bazaar, without using a hardcoded list.
- Read metadata directly from Bazaar, including descriptions, schemas, and pricing.
- Refresh every 5 minutes, so new endpoints appear without a restart.
- Automatically handle HTTP 402 and USDC payments.
- Multi-chain support: Base and Solana mainnet are live (both use USDC); Polygon, BNB, and EVM are extensible.
- On first run, it automatically discovers about 117 tools.
Usage: During installation, add the configuration to claude_desktop_config.json and set X402_PRIVATE_KEY to a Base EOA private key (hexadecimal, starting with 0x); this wallet needs to hold USDC on Base mainnet (Solana payments via SPL USDC are also supported). After restarting Claude Desktop, the server will automatically discover about 117 tools on first run.
The payment flow is: the agent calls a tool -> HTTP 402 -> x402-fetch signs EIP-3009 -> CDP Facilitator settles on Base or Solana -> response is returned. The buyer does not need to pay gas.
Costs and limits:
- Each tool call costs between $0.0001 and $0.10 USDC depending on the endpoint.
- There is a hard cap: set via the MAX_PRICE_USD environment variable (default $0.10 per call); calls above that price are blocked.
- The official recommendation is to use a fresh temporary wallet (burner wallet), not a main wallet.
Related resources: x402 protocol (https://x402.org)、CDP Bazaar(https://docs.cdp.coinbase.com/x402/bazaar)、MCP(https://modelcontextprotocol.io)、npm package (https://www.npmjs.com/package/x402node-mcp)、Glama(https://glama.ai/mcp/servers/x402node/x402-mcp)。更多平台支持与完整端点列表以官方文档为准,暂未提供。