SuperAPI AI Directory

agent-discovery-mcp

ERC-8004 agent discovery and x402 payment: find agents by skill via 8004scan, fetch agent cards and call agents with USDC payments using direct EOA signing.

Open website

About this tool

Purpose

agent-discovery-mcp is an MCP (Model Context Protocol) server whose goal is to enable your AI coding agent (Claude Code, OpenClaw, Codex, Cursor, etc.) to discover and call on-chain agents, and to pay automatically using Coinbase's x402 protocol.

On-chain agents register themselves via ERC-8004 (Ethereum's agent identity standard). This server bridges that registry with x402 payments, so that your existing tool runtime can look up and pay any on-chain agent in a single tool call—no smart accounts, no bundlers, no relayers. Just your EOA, one HTTPS request, and an automatic 402 → sign → retry flow.

Intended for: developers who are building or using AI coding agents and want to connect to the on-chain agent ecosystem without wiring up a custom discovery or payment stack themselves.

Main capabilities

Three tools are exposed via MCP, and the entire server is about 250 lines of TypeScript. No smart contract accounts, no bundlers, no third-party relayers—payments are signed directly by the EOA according to the x402 spec.

Discovery capabilities:

  • Agent discovery using the 8004scan public API (8004scan is the canonical ERC-8004 indexer maintained by the ERC-8004 team).

Payment capabilities:

  • Payments using Coinbase's official x402-fetch, which wraps native fetch to automatically handle 402 responses.
  • EOA signing using viem—no need to deploy contract accounts, no bundlers.

Result: install, set one environment variable, and your agent runtime can call any x402-supporting agent in the ERC-8004 registry.

Why this server exists (background, according to the materials):

  • x402 (Coinbase's payment protocol based on HTTP 402) had processed 165 million+ transactions and about $50 million in transaction volume as of April 2026.
  • ERC-8004 (Ethereum's agent identity standard) was deployed to mainnet on January 29, 2026, and there are currently tens of thousands of registered agents.
  • MCP (Anthropic's tool-calling protocol) is the de facto standard for connecting AI coding agents with external capabilities.

But at presentthere is a lack of a clean "glue" that lets Claude Code / OpenClaw / Cursor users directly discover and pay any on-chain agent within their existing tools. Existing solutions such as @azeth/mcp-server bundle ERC-4337 smart accounts and a custom trust layer on top—this forces a dependency on bundlers/relayers, and in practice may fail on testnets. This server skips all of that.

Usage

Requirements: Node ≥ 20.

Set the wallet private key (this is the EOA that will be used to sign x402 payments):

TEST_WALLET_KEY is only required for call_agent_with_payment; discovery tools (find_agents_by_skill, get_agent_card) work without it.

macOS LaunchAgent users (e.g. OpenClaw): use launchctl setenv instead, because LaunchAgent processes do not inherit your shell environment variables.

With Claude Code: Add it to .mcp.json in the project root or to ~/.claude/mcp_settings.json.

With OpenClaw: Add it under mcp.servers in ~/.openclaw/openclaw.json, then run openclaw gateway restart.

With Cursor / Cline / any MCP-compatible client: Standard MCP stdio server. Point the client at node /path/to/dist/index.js.

Example workflow: In your AI coding agent, just ask: "Find me 5 agents on Base mainnet that can do text summarization, only ones supporting x402." The agent will call find_agents_by_skill({ skill_keyword: "summarization", chain_id: 8453, x402_only: true, limit: 5 }) and return real on-chain agents.

"Call agent #25886 at its primary endpoint with the text "...long article...", pay max $0.05 USDC.” The agent will call call_agent_with_payment({ endpoint: "...", payload: { text: "..." }, max_pay_usdc: 0.05, chain_id: 8453 }). If the server returns 402, the EOA will sign an EIP-3009 USDC authorization, retry, and return the result.

Tool reference:

  • find_agents_by_skill
  • call_agent_with_payment

Supported chains, no smart contract account, no bundler, no relayer: your EOA signs, x402-fetch retries, the agent's facilitator settles.

Use cases

Suitable for directly accessing the on-chain agent ecosystem within an AI coding agent runtime environment: find agents by skill, retrieve agent cards, call and pay agent endpoints with USDC.

Limitations and current status

This is a usable v0.1.0 version; the underlying infrastructure is real, but the ecosystem is still in its early stages:

Discovery works: the 8004scan API returns real agents from the ERC-8004 registry (as of mid-2026, approximately 70,000+ cross-chain registrations).

Payment works: the x402 payment flow is end-to-end, using Coinbase's official x402-fetch library and EOA signatures.

Ecosystem caveats: many agents set x402Support: true in their metadata but do not enforce a paywall on their endpoints—they accept free calls or return 404. This flag is self-declared and no one has verified it yet. Currently, most production x402 traffic flows through hosted platforms (Coinbase Agent.market, AWS Bedrock AgentCore, etc.). The permissionless registry process is real but still early.

Roadmap (according to sources):

  • Perform endpoint health checks before find_agents_by_skill returns agents (filter out 404 demo deployments).
  • Verify on-chain x402Support claims by probing whether endpoints return 402.
  • Multi-chain payment in a single call (automatically select the cheapest chain for USDC).
  • Optional integration with Coinbase Facilitator to obtain settlement metadata.
  • Spending limit policy (a server-side cap independent of the max_pay_usdc parameter).
  • Record receipts to disk for tax/audit purposes.

This package is already listed on CodeGuilds (a directory of MCP servers and AI agent tools).

Platform support: works with Claude Code, OpenClaw, Cursor, and Cline.