agent-discovery-mcp

agent-discovery-mcp

An MCP server that lets your AI coding agent (Claude Code, OpenClaw, Codex, Cursor, etc.) discover and pay on-chain agents registered on ERC-8004, using Coinbase's official x402 protocol. No smart account. No bundler. No relay. Just your EOA, an HTTPS request, and an automatic 402 → sign → retry flow.

Category
访问服务器

README

agent-discovery-mcp

An MCP server that lets your AI coding agent (Claude Code, OpenClaw, Codex, Cursor, etc.) discover and pay on-chain agents registered on ERC-8004, using Coinbase's official x402 protocol.

No smart account. No bundler. No relay. Just your EOA, an HTTPS request, and an automatic 402 → sign → retry flow.


What it does

Three tools, exposed via Model Context Protocol:

Tool What it does Source of truth
find_agents_by_skill Search the ERC-8004 registry for agents matching a skill keyword. Returns id, chain, name, description, endpoint, and x402-support flag. 8004scan.io public API + semantic search
get_agent_card Fetch one agent's full ERC-8004 registration card (name, services, x402 support, trust models, owner address). 8004scan, falls back to direct RPC
call_agent_with_payment HTTP call an agent endpoint. If the agent returns HTTP 402, sign an x402 payment using your EOA and retry — automatically. x402-fetch (Coinbase official)

The whole server is ~250 lines of TypeScript. There's no smart contract account, no bundler, no third-party relay involved — payment is direct EOA signing per the x402 spec.


Why this exists

The pieces of an agent-to-agent economy are now real:

  • x402 (Coinbase's HTTP 402-based payment protocol) processes 165M+ transactions and ~$50M in volume as of April 2026.
  • ERC-8004 (Ethereum's agent identity standard) was deployed to mainnet on January 29, 2026 and now has tens of thousands of registered agents.
  • MCP (Anthropic's tool-call protocol) is the de-facto standard for connecting AI coding agents to external capability.

But there was no clean "glue" that lets a Claude Code / OpenClaw / Cursor user just discover and pay an arbitrary on-chain agent from inside their existing tool. Existing options like @azeth/mcp-server bundle ERC-4337 smart accounts and a custom trust layer on top — which forces a bundler/relay dependency that can fail in practice on testnets.

This server skips all of that. It uses:

  1. 8004scan public API for agent discovery (the canonical ERC-8004 indexer maintained by the ERC-8004 team)
  2. Coinbase's official x402-fetch for payment — wraps native fetch to handle 402s automatically
  3. viem for EOA signing — no contract account deployment, no bundler

The result: install, set one env var, and your agent runtime can call any x402 agent in the ERC-8004 registry.


Install

git clone https://github.com/<you>/agent-discovery-mcp
cd agent-discovery-mcp
npm install
npm run build

Set your wallet's private key (this is the EOA that will sign x402 payments):

export TEST_WALLET_KEY=0x...your-64-hex-private-key

macOS LaunchAgent users (e.g. OpenClaw): use launchctl setenv instead, since LaunchAgent processes don't inherit your shell env:

launchctl setenv TEST_WALLET_KEY 0x...

Use with OpenClaw

Add to ~/.openclaw/openclaw.json under mcp.servers:

{
  "mcp": {
    "servers": {
      "agent-discovery": {
        "command": "node",
        "args": ["/absolute/path/to/agent-discovery-mcp/dist/index.js"],
        "env": {
          "TEST_WALLET_KEY": "${TEST_WALLET_KEY}"
        }
      }
    }
  }
}

Then openclaw gateway restart.

Use with Claude Code

Add to .mcp.json in your project root or ~/.claude/mcp_settings.json:

{
  "mcpServers": {
    "agent-discovery": {
      "command": "node",
      "args": ["/absolute/path/to/agent-discovery-mcp/dist/index.js"],
      "env": {
        "TEST_WALLET_KEY": "${TEST_WALLET_KEY}"
      }
    }
  }
}

Use with Cursor / Cline / any MCP-compatible client

Standard MCP stdio server. Point your client at node /path/to/dist/index.js.


Example session

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.

Then:

Call agent #25886 at its primary endpoint with the text "...long article...", pay max $0.05 USDC.

The agent calls call_agent_with_payment({ endpoint: "...", payload: { text: "..." }, max_pay_usdc: 0.05, chain_id: 8453 }). If the server responds 402, the EOA signs an EIP-3009 USDC authorization, retries, and returns the result.


Reality check (May 2026)

The infrastructure works. The ecosystem is uneven:

  • ERC-8004 registry has ~70k+ agents across chains. Search works well.
  • Many agents on-chain set x402Support: true in their metadata but don't actually run an x402 paywall on their endpoint — they accept calls for free or return 404. The x402_supported flag is self-declared; nobody verifies it.
  • Most production x402 traffic today flows through Coinbase Agent.market, AWS Bedrock AgentCore, and similar managed platforms. The "permissionless agent discovery from a registry" flow is real but early.

This server lets you participate in that flow today, while it's still small.


Tools reference

find_agents_by_skill

{
  skill_keyword: string;       // e.g. "summarization", "code review", "price feed"
  limit?: number;              // 1-50, default 10
  chain_id?: number;           // e.g. 8453 (Base), 1 (Ethereum), 56 (BSC)
  x402_only?: boolean;         // filter to agents advertising x402 support
}

get_agent_card

{
  agent_id: number;            // ERC-8004 token ID
  chain_id: number;            // e.g. 8453
}

call_agent_with_payment

{
  endpoint: string;            // full HTTPS URL
  payload?: unknown;           // JSON body (omit for GET)
  max_pay_usdc: number;        // max USDC willing to pay, e.g. 0.10
  chain_id?: number;           // settlement chain, default 8453
}

Supported chains

Chain ID Network x402 settlement Discovery
1 Ethereum Mainnet ✅ ✅
8453 Base Mainnet ✅ ✅
56 BSC — ✅
84532 Base Sepolia ✅ ✅
11155111 Ethereum Sepolia ✅ ✅

Architecture

┌───────────────────────┐         ┌──────────────────────┐
│  Claude Code /        │  MCP    │  agent-discovery-mcp │
│  OpenClaw / Cursor    │ ──────▶ │  (this server)       │
└───────────────────────┘  stdio  └──────────┬───────────┘
                                              │
                          ┌───────────────────┼───────────────────┐
                          │                   │                   │
                          ▼                   ▼                   ▼
                   ┌────────────┐      ┌────────────┐      ┌─────────────┐
                   │ 8004scan   │      │ Base RPC   │      │ x402-fetch  │
                   │ public API │      │ (fallback) │      │ (Coinbase)  │
                   │ discovery  │      │ tokenURI   │      │ EOA signs   │
                   └────────────┘      └────────────┘      │ EIP-3009    │
                                                          └─────────────┘

No smart-contract account. No bundler. No relay. Your EOA signs, x402-fetch retries, agent's facilitator settles.


Roadmap

  • [ ] Endpoint health check before returning agent in find_agents_by_skill (filter out 404 demo deployments)
  • [ ] Verify on-chain x402Support claim by probing endpoint for 402 response
  • [ ] Multi-chain payment in one call (auto-select cheapest chain for USDC)
  • [ ] Optional integration with Coinbase Facilitator for settlement metadata
  • [ ] Spending-limit policy (server-side cap independent of max_pay_usdc parameter)
  • [ ] Receipt logging to disk for tax/audit

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选