Skip to content
@AgentAnycast

AgentAnycast

AgentAnycast

Decentralized P2P runtime for the A2A protocol.
Connect AI agents across any network — no public IP, no VPN, no configuration.

PyPI npm Daemon License


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 agentanycast

Why

A2A 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.

Quick Example

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 bridge

How It Works

A 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.

Repositories

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

Documentation

Community

Pinned Loading

  1. agentanycast agentanycast Public

    A2A Protocol over P2P — Agents talk without public IPs. Docs, specs, discussions.

    3

Repositories

Showing 8 of 8 repositories

Top languages

Loading…

Most used topics

Loading…