MCP server for ERC-8004 agent discovery + x402 payment. No smart account, no relay — just EOA signing. Works with Claude
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.
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.
The pieces of an agent-to-agent economy are now real:
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:
x402-fetch for payment — wraps native fetch to handle 402s automaticallyThe result: install, set one env var, and your agent runtime can call any x402 agent in the ERC-8004 registry.
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...
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.
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}"
}
}
}
}
Standard MCP stdio server. Point your client at node /path/to/dist/index.js.
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.
The infrastructure works. The ecosystem is uneven:
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.This server lets you participate in that flow today, while it's still small.
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
}
| Chain ID | Network | x402 settlement | Discovery |
|---|---|---|---|
| 1 | Ethereum Mainnet | ✅ | ✅ |
| 8453 | Base Mainnet | ✅ | ✅ |
| 56 | BSC | — | ✅ |
| 84532 | Base Sepolia | ✅ | ✅ |
| 11155111 | Ethereum Sepolia | ✅ | ✅ |
┌───────────────────────┐ ┌──────────────────────┐
│ 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.
find_agents_by_skill (filter out 404 demo deployments)x402Support claim by probing endpoint for 402 responsemax_pay_usdc parameter)MIT
Run analytics queries on ClickHouse — explore schemas, execute SQL, fetch results
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots
Google's universal MCP server supporting PostgreSQL, MySQL, MongoDB, Redis, and 10+ databases