Decentralized P2P runtime for the A2A protocol.
Connect AI agents across any network — no public IP, no VPN, no configuration.
AgentAnycast implements the A2A (Agent-to-Agent) protocol over libp2p peer-to-peer connections. It gives AI agents the ability to securely find and talk to each other across any network — laptops behind NAT, corporate firewalls, or across the internet — with automatic encryption, NAT traversal, and skill-based discovery.
pip install agentanycast # or: npm install agentanycastA2A requires every agent to be an HTTP server with a public URL. This excludes agents behind NAT, behind firewalls, and in environments where centralized gateways are unacceptable. AgentAnycast provides the missing transport layer — zero-config connectivity, end-to-end encryption (Noise_XX), automatic NAT traversal, and capability-based routing where the network finds the right agent for you.
from agentanycast import Node, AgentCard, Skill
card = AgentCard(
name="EchoAgent",
skills=[Skill(id="echo", description="Echo the input")],
)
async with Node(card=card) as node:
@node.on_task
async def handle(task):
text = task.messages[-1].parts[0].text
await task.complete(artifacts=[{"parts": [{"text": f"Echo: {text}"}]}])
await node.serve_forever()Three ways to reach another agent:
await node.send_task(peer_id="12D3KooW...", message=msg) # by Peer ID
await node.send_task(skill="translate", message=msg) # by skill
await node.send_task(url="https://agent.example.com", message=msg) # via HTTP bridgeA thin SDK (Python or TypeScript) communicates over gRPC with a local Go daemon that handles P2P networking, Noise_XX encryption, and A2A protocol logic. On a LAN, agents discover each other via mDNS with zero configuration. Across networks, a self-hosted relay provides NAT traversal and hosts a skill registry for capability-based routing — the relay cannot read any traffic.
Built-in adapters for CrewAI, LangGraph, Google ADK, and OpenAI Agents SDK. The daemon also runs as an MCP server for Claude Desktop, Cursor, and ChatGPT.
| Repository | Description |
|---|---|
| agentanycast | Documentation, examples, discussions — start here |
| agentanycast-python | Python SDK — pip install agentanycast |
| agentanycast-ts | TypeScript SDK — npm install agentanycast |
| agentanycast-node | Go daemon — P2P, encryption, A2A engine, MCP server |
| agentanycast-relay | Relay server + skill registry + federation |
| agentanycast-proto | Protocol Buffer definitions — single source of truth |
- Getting Started — Install, run your first agent, connect two agents
- Architecture — Sidecar model, security, NAT traversal, MCP, federation
- Python SDK Reference — Complete API documentation
- Deployment Guide — Production relay, HTTP bridge, metrics, security
- Protocol Reference — Wire format, task lifecycle, gRPC services
- Examples — Skill routing, framework adapters, streaming, LLM agents
- GitHub Discussions — questions, ideas, show & tell
- Contributing Guide — how to get involved
