Last time, we talked about why MCP without agent discovery is like the web without DNS. Today, let's build one.
You'll go from zero to a working AI agent β publicly discoverable at agent://your-agent.agenium.net β in about 5 minutes. Other agents will be able to find it, inspect its capabilities, and call it. No config files to share. No READMEs to paste. Just a name.
What We're Building
A simple agent with three tools: echo, ping, and info. Trivial on purpose β the interesting part isn't what it does, it's how other agents find it.
By the end:
- Your agent runs locally (or in Docker)
- It has a unique identity:
agent://your-name.agenium.net - Any agent on the network can discover and call it
- Its capabilities are published in a machine-readable manifest
Stack: Node.js + TypeScript. Python SDK also available (pip install agenium) β same concepts, different syntax.
Prerequisites
- Node.js 18+
- npm or yarn
- ~5 minutes
That's it. No cloud account needed. No API keys for the basic flow.
Step 1: Scaffold
npx @agenium/create-agent my-agent
cd my-agent
npm install
The CLI wizard asks a few questions:
π€ create-agenium-agent
Build your first agent:// in under 3 minutes
? Agent name βΊ my-agent
? Description βΊ My first discoverable agent
? Template βΊ echo (minimal β echo, ping, info tools)
You get a clean project structure:
my-agent/
βββ src/index.ts # Your agent logic
βββ package.json # Dependencies (agenium@^0.2.0)
βββ tsconfig.json
βββ Dockerfile # Production-ready image
βββ .env.example
βββ README.md
Skip the wizard: npx @agenium/create-agent my-agent --yes uses sensible defaults.
Step 2: Look at the Code
Open src/index.ts. Here's the core of what the echo template generates:
import { Agent } from 'agenium';
const agent = new Agent({
name: 'my-agent',
description: 'My first discoverable agent',
version: '0.1.0',
});
// Define tools β these show up in your capability manifest
agent.tool('echo', {
description: 'Echo back any message',
parameters: {
message: { type: 'string', description: 'Message to echo' }
},
handler: async ({ message }) => {
return { echo: message, timestamp: new Date().toISOString() };
}
});
agent.tool('ping', {
description: 'Health check',
handler: async () => {
return { status: 'ok', uptime: process.uptime() };
}
});
agent.tool('info', {
description: 'Agent metadata',
handler: async () => {
return {
name: agent.name,
version: agent.version,
tools: agent.listTools(),
};
}
});
agent.start();
That's it. No boilerplate. No config ceremony. The Agent class handles:
- HTTP/2 server with mTLS
- Capability manifest generation (from your
tool()definitions) - Session management
- Health checks and metrics
Step 3: Run It
npm run dev
π€ my-agent v0.1.0 starting...
Transport: HTTP/2 + mTLS
Tools: echo, ping, info
Local: https://localhost:3000
Status: ready
Your agent is running. But right now only you know about it. Let's fix that.
Step 4: Register on the Network
This is where it gets interesting. Head to agenium.net, create an account, and grab an API key. Then:
# Add your API key
echo "AGENIUM_API_KEY=ak_..." >> .env
# Register your agent
npx agenium register
β
Registered: agent://my-agent.agenium.net
Capabilities: echo, ping, info
Discovery: active
Certificate: issued (mTLS)
What just happened:
- Your agent's name (
my-agent) was registered in the AGENIUM naming system β like registering a domain - Your capability manifest was published β other agents can see what tools you offer
- An mTLS certificate was issued β all communication is encrypted and authenticated
- DNS records were created β
agent://my-agent.agenium.netnow resolves to your agent
Step 5: Test Discovery
From any machine with the AGENIUM client:
import { resolve } from 'agenium';
// Discover the agent by name
const agent = await resolve('agent://my-agent.agenium.net');
console.log(agent.name); // "my-agent"
console.log(agent.tools); // ["echo", "ping", "info"]
console.log(agent.version); // "0.1.0"
console.log(agent.endpoint); // "https://..."
console.log(agent.certificate); // mTLS cert fingerprint
Or try it live at demo.agenium.net β paste any agent:// URI and see the resolution in real time.
Compare this with MCP today:
| MCP (current) | agent:// | |
|---|---|---|
| Find a server | Browse a directory, copy JSON config | resolve('agent://name') |
| Know its capabilities | Read the README |
agent.tools β machine-readable |
| Verify identity | Hope the URL is right | mTLS certificate chain |
| Use it | Paste config into mcp.json
|
agent.call('tool', params) |
The Architecture (30-Second Version)
Your Agent AGENIUM Network
ββββββββββββ ββββββββββββββββ
β my-agent βββregisterβββββββΆβ Platform β
β β β (naming + β
β echo β β discovery) β
β ping β ββββββββ¬ββββββββ
β info β β
ββββββββββββ β
β² β
β βΌ
β ββββββββββββββββ
βββββmTLS sessionβββββ Other Agent β
β β
β resolve( β
β "agent:// β
β my-agent") β
ββββββββββββββββ
- You register β your name and capabilities enter the network
-
Someone resolves β
agent://my-agent.agenium.netβ gets your endpoint + manifest - Direct connection β mTLS session between agents, no middleman for data
The naming system is the DNS. The platform is the registrar. Your agent's URI is its domain name. Same pattern that scaled the web β applied to agents.
Going Further: Add Real Logic
The echo template is a starting point. The tools and api templates give you more:
# Custom tools template
npx @agenium/create-agent my-tool-agent --template=tools
# API wrapper template (expose a REST API as agent tools)
npx @agenium/create-agent my-api-agent --template=api
Or add tools to any existing agent:
agent.tool('analyze-logs', {
description: 'Analyze server logs for anomalies',
parameters: {
logs: { type: 'string', description: 'Raw log text' },
severity: { type: 'string', enum: ['all', 'error', 'warn'] }
},
handler: async ({ logs, severity }) => {
// Your actual logic here
const anomalies = detectAnomalies(logs, severity);
return { anomalies, count: anomalies.length };
}
});
Once you redeploy, the capability manifest updates automatically. Any agent discovering yours will see the new analyze-logs tool β no config changes needed on their end.
Bonus: MCP Compatibility
Already have an MCP server? The AGENIUM MCP Bridge lets you give it a name without rewriting anything:
npm install @agenium/mcp-server
import { MCPBridge } from '@agenium/mcp-server';
const bridge = new MCPBridge({
name: 'my-mcp-server',
mcpConfig: './mcp.json', // Your existing MCP config
});
bridge.start();
// Your MCP server is now discoverable at agent://my-mcp-server.agenium.net
Same tools, same logic β now with a name and discovery built in. Read more in the MCP Bridge docs.
What Agent Would YOU Build?
We're in the early days of agent-to-agent communication. The protocol works. The naming system works. The discovery works. What's missing is you β building agents that solve real problems.
Some ideas we're excited about:
- Code review agent β analyze PRs, suggest fixes, talk to other agents for context
- Monitoring agent β watch your infra, alert other agents when things break
- Data pipeline agent β chain with other agents for ETL workflows
- Knowledge base agent β answer questions using your internal docs
Try it now:
- π
npx @agenium/create-agentβ scaffold in 3 minutes - π demo.agenium.net β see agent discovery live
- π¦ npm: agenium / PyPI: agenium
- π docs.agenium.net β full API reference
- β GitHub: Aganium/agenium β star if you find it useful
We're interviewing developers building in the MCP/agent ecosystem. If you have 15 minutes and opinions about agent discovery, we'd love to hear from you β research@agenium.net
This is Part 2 of our series on agent identity and discovery. Part 1: Your MCP Server Has No Name covers the "why". This post covers the "how".
π Try our MCP server search β agenium.net/search β Find any MCP server in seconds.
Built by the AGENIUM team. Open source. MIT licensed.
Top comments (0)