agent-network
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agent-networkask shahriyar what authentication library the frontend uses"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agent-network
⚠️ This project is currently under active development. Features may be incomplete, APIs may change, and things may break. Use at your own risk.
Let your Claude Code talk to your friend's Claude Code. Ask questions about their codebase or delegate coding tasks to their agent — all from your terminal.
Your Claude Code --> MCP Server --> HTTP --> Friend's A2A Server --> Claude Agent SDK
(ask_agent) (stdio) (a2a) (Express) (query())Step-by-Step Setup (You + One Friend)
Both you and your friend follow these steps on your own machines.
Step 1: Clone and install
git clone git@github.com:sharifli4/agent-network.git
cd agent-network
npm installStep 2: Generate your bearer token
This is your password — it protects your agent from unauthorized access.
openssl rand -hex 32Save the output. You'll need it in the next step AND you'll share it with your friend.
Step 3: Create your .env file
cp .env.example .envEdit .env with your values:
PORT=3000
BEARER_TOKEN=<paste your generated token here>
AGENT_NAME=kenan
AGENT_DESCRIPTION=Backend API agent (NestJS)
WORKING_DIRECTORY=/home/kenan/repositories/my-project
ANTHROPIC_API_KEY=sk-ant-your-key-hereWhat each variable does:
Variable | What it is | Example |
| Port your server runs on |
|
| Your token — share this with your friend |
|
| Your name |
|
| What your codebase is about |
|
| The project folder your agent can access |
|
| Your Anthropic API key |
|
Step 4: Exchange info with your friend
Send your friend:
Your IP address (run
ip addr | grep 'inet ' | grep -v 127.0.0.1)Your port (default
3000)Your bearer token
Get from your friend:
Their IP address
Their port
Their bearer token
Step 5: Create agents.config.json
This file tells your MCP tools where your friend's agent lives.
cp agents.config.example.json agents.config.json
chmod 600 agents.config.jsonEdit it with your friend's info:
{
"agents": [
{
"name": "shahriyar",
"url": "http://192.168.1.50:3000",
"description": "Frontend agent (React Native)",
"bearerToken": "token-your-friend-gave-you"
}
]
}You can add multiple friends — just add more entries to the agents array.
Step 6: Start your A2A server
npm run dev:serverYou should see:
A2A server listening on port 3000
Agent card: http://localhost:3000/.well-known/agent.json
A2A endpoint: http://localhost:3000/a2aVerify it works:
curl http://localhost:3000/health
# {"status":"ok"}Step 7: Add MCP server to Claude Code
Edit ~/.claude/settings.json and add:
{
"mcpServers": {
"agent-network": {
"command": "npx",
"args": ["tsx", "/home/you/agent-network/src/mcp/index.ts"],
"env": {
"AGENT_NETWORK_CONFIG": "/home/you/agent-network/agents.config.json"
}
}
}
}Replace
/home/you/agent-networkwith your actual path.
Restart Claude Code for the MCP server to load.
Step 8: Test the connection
Before using Claude Code, verify you can reach your friend's server:
# Check their agent card
curl http://<friends-ip>:3000/.well-known/agent.json
# Send a test RPC call
curl -X POST http://<friends-ip>:3000/a2a \
-H "Authorization: Bearer <token-they-gave-you>" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tasks/get","params":{"id":"test"}}'If you get a JSON response (even an error like "Task not found"), the connection works.
Related MCP server: cc-agent
Usage
Once everything is set up, you have 3 tools available in Claude Code:
1. List your network
"Who can I talk to?"
Just ask Claude Code to list agents, or it will call:
list_agentsReturns all agents from your agents.config.json.
2. Ask a question (read-only)
"Ask my friend about their codebase"
ask shahriyar what authentication library the frontend usesClaude Code calls ask_agent under the hood. The remote agent can only read files — it cannot modify anything. Use this for:
"What framework does the frontend use?"
"How does their auth flow work?"
"What API endpoints does their app call?"
"What's the structure of their project?"
3. Delegate a task (read + write)
"Tell my friend's agent to do something"
delegate to shahriyar: add a loading spinner to the login screenClaude Code calls delegate_task under the hood. The remote agent can read and write files. Use this for:
"Add error handling to the API client"
"Create a new component for the settings page"
"Fix the bug in the checkout flow"
"Update the API response type to match the new backend schema"
Networking
Both machines must be able to reach each other over HTTP. Options:
Situation | Solution |
Same WiFi / LAN | Use local IP addresses ( |
Different networks | Use Tailscale or WireGuard for a private tunnel |
Quick test over internet | Use ngrok: |
Have a server | SSH tunnel: |
How It Works
A2A Server (Express) — you host this on your machine. When a friend's agent sends a request, it:
Authenticates the bearer token
Creates a task
Runs the Claude Agent SDK against your
WORKING_DIRECTORYReturns the result
MCP Server (stdio) — runs inside your Claude Code. Provides the 3 tools above. When you use a tool, it sends an HTTP request to your friend's A2A server.
Security:
ask_agent= read-only (tools:Read,Glob,Grep,Bash)delegate_task= full access (adds:Edit,Write)All requests require a valid bearer token
agents.config.jsoncontains tokens — keep it private (chmod 600)
A2A Protocol
The server implements a subset of the A2A protocol:
Endpoint | Description |
| Agent card (name, description, capabilities) |
| Health check |
| JSON-RPC 2.0 — |
Scripts
Command | Description |
| Start A2A server (development, with hot reload) |
| Start MCP server (development) |
| Compile TypeScript to |
| Start compiled A2A server |
| Start compiled MCP server |
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sharifli4/agent-network'
If you have feedback or need assistance with the MCP directory API, please join our Discord server