npx CLI that scaffolds blockchain-registered AI agents with on-chain identity (ERC-8004), A2A communication, MCP tool serving, and optional USDC micropayments across EVM and Solana.
create-8004-agent is a growing TypeScript project in the AI payments / x402 ecosystem, focused on 8004, agentic-ai, erc-8004. It currently has 51 GitHub stars and 22 forks, and sits alongside related tools like sati, awesome-agent-economy, awesome-agent-economy, Rachax402, agent-apprenticeship, agent-apprenticeship.
CLI tool to scaffold ERC-8004 compliant AI agents with A2A, MCP, and x402 payment support.
Supports both EVM chains and Solana.
ERC-8004 is a protocol for discovering and trusting AI agents across organizational boundaries. It provides:
Before using the generator, ensure you have:
npx create-8004-agent
That's it! The wizard will guide you through creating your agent.
If you want 4mica-powered x402 payments, choose a supported chain (Ethereum Sepolia or Polygon Amoy), enable x402 payments, and select 4mica as the provider when prompted.
The wizard creates a complete agent project with:
my-agent/
├── package.json
├── .env.example
├── registration.json # ERC-8004 metadata
├── tsconfig.json
├── src/
│ ├── register.ts # On-chain registration script
│ ├── agent.ts # LLM agent (OpenAI)
│ ├── a2a-server.ts # A2A protocol server (optional)
│ ├── mcp-server.ts # MCP protocol server (optional)
│ └── tools.ts # MCP tools (optional)
└── .well-known/
└── agent-card.json # A2A discovery card
| Option | Description |
|---|---|
| Project directory | Where to create the project |
| Agent name | Your agent's name |
| Agent description | What your agent does |
| Agent image | URL to your agent's image/logo |
| Agent wallet | EVM or Solana address (leave empty to auto-generate) |
| A2A server | Enable agent-to-agent communication |
| A2A streaming | Enable Server-Sent Events (SSE) for streaming responses |
| MCP server | Enable Model Context Protocol tools |
| x402 payments | x402 USDC micropayments (Base, Polygon) |
| Chain | EVM: Ethereum, Base, Polygon, Monad (mainnet + testnets) / Solana: Devnet |
| Trust models | reputation, crypto-economic, tee-attestation |
| Chain | Identity Registry | Status |
|---|---|---|
| ETH Sepolia | 0x8004A818BFB912233c491871b3d84c89A494BD9e |
✅ Available |
| Base Sepolia | 0x8004A818BFB912233c491871b3d84c89A494BD9e |
✅ Available |
| SKALE Base | 0x8004A818BFB912233c491871b3d84c89A494BD9e |
✅ Available |
| SKALE Base Sepolia | 0x8004A818BFB912233c491871b3d84c89A494BD9e |
✅ Available |
| Avalanche C-Chain | Via agent0-sdk (chainId 43114) | ✅ Available |
| Avalanche Fuji | Via agent0-sdk (chainId 43113) | ✅ Available |
| Network | Program ID |
|---|---|
| Devnet | HvF3JqhahcX7JfhbDRYYCJ7S3f6nJdrqu5yi9shyTREp |
After generating your project:
cd my-agent
npm install
Edit .env and fill in:
PRIVATE_KEY=... # Auto-generated if you left wallet empty
OPENAI_API_KEY=your_openai_key # For LLM responses
PINATA_JWT=your_pinata_jwt # If using IPFS storage (requires pinJSONToIPFS scope)
Auto-generated wallet: If you left the wallet address empty, a new wallet was generated and the private key is already in .env. Back up your .env file and fund the wallet with testnet tokens before registering.
solana airdrop or faucetsPinata JWT: Create an API key at pinata.cloud with pinJSONToIPFS scope for public IPFS pinning.
npm run register
EVM chains: Uploads metadata to IPFS and mints an NFT on the Identity Registry.
Solana: Validates metadata using buildRegistrationFileJson(), uploads to IPFS, and mints a Metaplex Core NFT via the 8004 program.
After registration, view your agent on 8004scan.io.
If you update your agent's name, description, image, or OASF skills in src/register.ts, you need to sync these changes on-chain:
src/register.ts.npm run register
This will upload the new metadata to IPFS and update your agent's URI on the Identity Registry.
# Start A2A server
npm run start:a2a
# Start MCP server (in another terminal)
npm run start:mcp
The generated A2A server implements:
/.well-known/agent-card.json/a2amessage/send, tasks/get, tasks/cancel1. Start the server:
npm run start:a2a
2. Test the agent card:
curl http://localhost:3000/.well-known/agent-card.json
3. Test the JSON-RPC endpoint:
curl -X POST http://localhost:3000/a2a \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "message/send",
"params": {
"message": {
"role": "user",
"parts": [{"type": "text", "text": "Hello!"}]
}
},
"id": 1
}'
x402 payment support enables USDC micropayments for your agent. Available on:
| Chain | Facilitator | Status |
|---|---|---|
| Base Mainnet | PayAI | ✅ Production |
| Base Sepolia | PayAI | ✅ Testnet |
| Polygon Mainnet | PayAI | ✅ Production |
| Polygon Amoy | PayAI | ✅ Testnet |
| SKALE Base | PayAI | ✅ Production |
| SKALE Base Sepolia | PayAI | ✅ Testnet |
When enabled, the A2A server uses x402 middleware for micropayments:
.env: X402_PAYEE_ADDRESS, X402_PRICEX402_TAB_ENDPOINT (public tab endpoint advertised to clients)If you select x402 payments and choose 4mica during the wizard, you will be prompted:
Register with 4mica now (optional collateral deposit)?
If you say yes, the CLI will:
You can safely skip this step if you are not ready to fund the wallet yet. The agent still generates and runs; you can enable 4Mica later after funding a wallet.
The generated MCP server includes sample tools:
chat - Conversation with the LLMecho - Echo back input (testing)get_time - Current timestampAdd your own tools in src/tools.ts.
MCP uses stdio for communication. To test with the MCP Inspector:
# Install MCP Inspector
npx @modelcontextprotocol/inspector
# Or test directly with your MCP client
npm run start:mcp
The server will communicate over stdin/stdout following the MCP protocol.
{
"type": "https://eips.ethereum.org/EIPS/eip-8004#registration-v1",
"name": "My Agent",
"description": "An AI agent...",
"image": "https://example.com/image.png",
"endpoints": [
{
"name": "A2A",
"endpoint": "http://localhost:3000/.well-known/agent-card.json",
"version": "0.3.0"
},
{
"name": "MCP",
"endpoint": "http://localhost:3001",
"version": "2025-06-18"
},
{
"name": "agentWallet",
"endpoint": "eip155:11155111:0x..."
}
],
"registrations": [
{
"agentId": 123,
"agentRegistry": "eip155:11155111:0x8004..."
}
],
"supportedTrust": ["reputation", "crypto-economic", "tee-attestation"]
}
npm test
To run the full x402 integration tests (verifying paid requests work), you need a test wallet with testnet USDC:
.env file in the project root:TEST_PAYER_PRIVATE_KEY=0x...your_private_key...
If TEST_PAYER_PRIVATE_KEY is not set, x402 paid request tests will be skipped (other tests still run).
MIT
Trust infrastructure for million-agent economies on Solana - identity, reputation, and validation designed for continuous feedback at scale.
Explore and connect projects enabling AI agents to earn, trade, verify identity, and build reputation in the agent economy ecosystem.
A curated list of projects, protocols, and platforms powering the AI agent economy
Decentralized Agent-to-Agent service discovery and payment-gated task execution: Discover agents via ERC-8004, pay over x402, & store data on Storacha.
The living ecosystem where AI agents complete tasks through workflow loops, improve through iterative execution, are evaluated by mentor agents or humans in the loop, and turn completed work into reusable work experience and data to improve future agents.
The living ecosystem where AI agents complete tasks through workflow loops, improve through iterative execution, are evaluated by mentor agents or humans in the loop, and turn completed work into reusable work experience and data to improve future agents.
A local-first AI agent with persistent memory, emotional intelligence, and a peer-to-peer skills economy.
The trust layer for agent-to-agent commerce — natural-language mandates, ERC-7710 delegated permissions, x402 payments, escrow, and dispute resolution as one open, catch-all Agent Skill / Claude Code plugin.
Agent behavior that compiles
The A2A x402 Extension brings cryptocurrency payments to the Agent-to-Agent (A2A) protocol, enabling agents to monetize their services through on-chain payments. This extension revives the spirit of HTTP 402 "Payment Required" for the decentralized agent ecosystem.
Aser is a lightweight, self-assembling AI Agent frame.
Golang SDK for A2A Protocol