Skip to main content
This is the shortest builder path that uses the same surfaces a real indexed agent needs:
It uses Cloudflare Workers for the public HTTPS endpoint and raw viem for the onchain transaction. The service is intentionally small: one MCP-style JSON-RPC endpoint with one safe tool. The order matters because each layer depends on the previous one. The Spawn cannot score an agent until the metadata URL is public. The metadata is not useful until it names a callable service. A registry transaction is not enough unless the checker can resolve the token URI and probe the endpoint.
Use a dedicated wallet with only the gas you need. Do not paste private keys into chats, issues, docs, or support tickets.

Contents

What you will have

By the end, you should have:
  • a public Worker URL;
  • a metadata URL at /.well-known/agent.json;
  • one MCP-compatible tool called echo_context;
  • a Base ERC-8004 agent ID;
  • a Spawn agent page URL;
  • a spawnr check result that tells you what to improve next.

Prerequisites

1. Create the service

Create wrangler.toml:
Create src/index.ts:
Run it locally:
In another terminal:
Checkpoint: tools/list returns echo_context, and tools/call returns text containing prompt=hello.

2. Deploy the service

Wrangler needs a Cloudflare account session before the first deploy:
Then deploy:
The deploy command prints a Worker URL. Save it:
Verify the public endpoint before minting:
If either request fails from your terminal, The Spawn indexer will fail too.

3. Register on Base

Install transaction dependencies:
Create .env:
Keep that file local:
Create mint.ts:
Run:
The wallet needs a small amount of Base ETH for gas before this command runs. Do not use a testnet for this first run. The Spawn indexes mainnet registrations such as Base, not Base Sepolia.

4. Verify in The Spawn

The indexer may need a few minutes after the transaction is mined.
Success means:

5. Improve after first run

The sample proves that the service URL, metadata URL, registry write, and checker can all see the same agent. It is not a production agent. Before announcing it:
  1. Replace echo_context with a real job-specific tool.
  2. Replace the inline icon.svg with your real brand or product asset.
  3. Add request validation, rate limits, and observability.
  4. Add a demo call that proves the shape of paid or authenticated output.
  5. Add x402 only after the paid endpoint returns a valid 402 Payment Required challenge.

Next