AgentAnycast
OfficialExposes detailed observability metrics including connected peer counts, task statuses, routing latency, and system performance for monitoring via Prometheus.
AgentAnycast Node
The core daemon powering AgentAnycast's P2P agent network.
AgentAnycast Node (agentanycastd) is a sidecar daemon that runs on each machine, providing P2P networking, end-to-end encryption, and A2A protocol routing. Language SDKs (Python, TypeScript) communicate with it over gRPC.
Fully decentralized. On a local network, agents discover each other via mDNS with zero configuration. For cross-network communication, deploy your own relay with a single command.
Features
Category | Capabilities |
Networking | libp2p (TCP, QUIC, WebTransport), NATS transport, mDNS auto-discovery, NAT traversal (AutoNAT + DCUtR + Circuit Relay v2) |
Security | E2E NaCl box encryption (X25519 + XSalsa20-Poly1305), W3C DID identity ( |
A2A Protocol | Task state machine, 3 addressing modes (direct / anycast / HTTP bridge), streaming artifacts, offline message queue |
Interop | HTTP Bridge (P2P ↔ HTTP A2A), ANP Bridge (Agent Network Protocol), MCP Server (stdio + Streamable HTTP) |
Enterprise | Audit logging (JSON Lines), Prometheus metrics, OpenTelemetry tracing (W3C Trace Context, OTLP) |
AI Tools | MCP Server for 13+ AI platforms, MCP Remote Proxy to wrap any MCP Server as a P2P agent |
Quick Start
Standalone -- local network (zero configuration)
go build -o agentanycastd ./cmd/agentanycastd
./agentanycastd
# Agents on the same LAN discover each other automatically via mDNSWith Python SDK
pip install agentanycastfrom agentanycast import Node
async with Node(skills=["translate"]) as node:
# The daemon starts automatically — no manual setup needed
result = await node.send_task("summarize", "Hello world")MCP mode -- use as an AI tool
# stdio mode (Claude Desktop, Cursor, VS Code, Gemini CLI)
./agentanycastd -mcp
# Streamable HTTP mode (ChatGPT, remote clients)
./agentanycastd -mcp-listen :3000Cross-network -- deploy your own relay
# On any VPS with a public IP
git clone https://github.com/AgentAnycast/agentanycast-relay && cd agentanycast-relay
docker-compose up -d
# Note the RELAY_ADDR from the logs, then:
./agentanycastd -bootstrap-peers "/ip4/<RELAY_IP>/tcp/4001/p2p/12D3KooW..."Configuration
Priority: CLI flags > environment variables > config file > defaults
CLI Flags
Flag | Description |
| Path to identity key file |
| gRPC listen address (unix:// or tcp://) |
| Log level ( |
| Comma-separated bootstrap multiaddrs |
| HTTP bridge listen address (e.g., |
| Enable WebTransport (QUIC-based, browser-compatible) |
| Run as MCP server over stdio |
| MCP Streamable HTTP listen address (e.g., |
| Wrap an MCP Server command as a P2P-accessible agent |
| ANP bridge listen address (e.g., |
| NATS broker URL (e.g., |
| OTLP collector endpoint for distributed tracing |
| Prometheus metrics listen address (e.g., |
| Path to TOML config file |
| Print version and exit |
Environment Variables
Variable | Default |
|
|
|
|
|
|
|
|
| (none) |
|
|
| (none) |
| (none) |
Config File
Default location: ~/.agentanycast/config.toml
key_path = "~/.agentanycast/key"
grpc_listen = "unix://~/.agentanycast/daemon.sock"
log_level = "info"
log_format = "json"
store_path = "~/.agentanycast/data"
enable_mdns = true
enable_quic = true
enable_webtransport = false
enable_relay_client = true
enable_hole_punching = true
offline_queue_ttl = "24h"
bootstrap_peers = ["/ip4/203.0.113.50/tcp/4001/p2p/12D3KooW..."]
[bridge]
enabled = false
listen = ":8080"
# tls_cert = "/path/to/cert.pem"
# tls_key = "/path/to/key.pem"
# cors_origins = ["*"]
[anycast]
routing_strategy = "random"
cache_ttl = "30s"
auto_register = true
# registry_addr = "relay.example.com:50052"
# registry_addrs = ["relay1:50052", "relay2:50052"] # federation
enable_dht = false
dht_mode = "auto" # "auto", "server", or "client"
[metrics]
enabled = false
listen = ":9090"
[mcp]
enabled = false
listen = ":3000"
[anp]
enabled = false
listen = ":8090"
# NATS Transport
[transport.nats]
enabled = true
broker = "nats://broker.example.com:4222"
subject_prefix = "agent."
# Enterprise Policy
[policy]
acl_rules = [
{ source = "*", skill = "*", allow = true },
]
[policy.rate_limits]
default_rps = 100
audit_log_path = "/var/log/agentanycast-audit.jsonl"
# OpenTelemetry
[otel]
enabled = false
otlp_endpoint = "localhost:4317"
[identity]
# did_web = "did:web:example.com:agents:myagent"
# did_dns_domain = "example.com"Architecture
┌──────────────────────────────────────────────────────────────────────┐
│ agentanycastd │
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │
│ │ Engine │ │ Router │ │ Offline │ │ Anycast Router │ │
│ │(task FSM) │ │(A2A msg) │ │ Queue │ │(skill discovery) │ │
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────────────┘ │
│ │ │ │ │ │
│ ┌────┴──────────────┴─────────────┴──────────────┴──────────────┐ │
│ │ Envelope Layer (E2E NaCl box encryption) │ │
│ ├───────────────────────────────────────────────────────────────┤ │
│ │ Transport Adapters │ │
│ │ libp2p (mDNS · TCP · QUIC · WebTransport · DHT) │ │
│ │ NATS · HTTP Bridge · Circuit Relay v2 · DCUtR │ │
│ └──────────────────────┬───────────────────────────────────────┘ │
│ │ │
│ ┌──────────────────────┴──────────────────────────────────────┐ │
│ │ gRPC Server (16 RPCs for SDKs) │ │
│ └─────────────────────────────────────────────────────────────┘ │
│ │
│ ┌────────────┐ ┌────────────┐ ┌──────────┐ ┌────────┐ ┌──────────┐ │
│ │ HTTP Bridge│ │ MCP Server │ │ANP Bridge│ │ OTel │ │MCP Proxy │ │
│ │ (A2A↔P2P) │ │(stdio/HTTP)│ │(ANP↔A2A) │ │(trace) │ │(wrap cmd)│ │
│ └────────────┘ └────────────┘ └──────────┘ └────────┘ └──────────┘ │
│ │
│ ┌────────┐ ┌──────┐ ┌─────────┐ ┌──────────────────┐ │
│ │Metrics │ │BoltDB│ │ ACL / │ │ Audit Logger │ │
│ │(Prom.) │ │(stor)│ │RateLimit│ │ (JSON Lines) │ │
│ └────────┘ └──────┘ └─────────┘ └──────────────────┘ │
└──────────────────────────────────────────────────────────────────────┘Internal Packages
Package | Responsibility |
| A2A protocol engine -- task state machine, envelope routing, offline queue, streaming |
| libp2p host -- peer connections, mDNS, DHT, TCP/QUIC/WebTransport |
| Ed25519 keys, DID conversion ( |
| AutoNAT, DCUtR hole punching, Circuit Relay v2 client |
| BoltDB persistence -- tasks, agent cards, offline queue |
| TOML config, environment variables, CLI flags |
| Protocol-neutral message routing, E2E NaCl box encryption |
| Pluggable transport adapters -- libp2p, NATS, HTTP bridge |
| HTTP Bridge -- translates HTTP JSON-RPC ↔ P2P A2A envelopes |
| Anycast router -- skill-based addressing, multi-registry federation, DHT discovery |
| MCP Server -- P2P capabilities as MCP tools (stdio + Streamable HTTP) |
| MCP Remote Proxy -- wraps external MCP commands as P2P agents |
| ANP Bridge -- translates ANP HTTP ↔ A2A P2P (JSON-RPC 2.0 + JSON-LD) |
| Enterprise policy -- skill-based ACL, per-peer rate limiting, audit logging |
| Prometheus metrics -- connections, tasks, routing, bridge, streaming, MCP |
| OpenTelemetry -- distributed tracing, W3C Trace Context, OTLP exporter |
| gRPC server -- 16 RPC methods for SDKs |
gRPC API
Group | Methods |
Node |
|
Peers |
|
Task Client |
|
Task Server |
|
Streaming |
|
Discovery |
|
MCP Server
The daemon can run as an MCP (Model Context Protocol) server, exposing P2P capabilities as tools for AI assistants.
Tool | Description |
| Get local node information |
| List connected peers |
| Get local or remote agent card |
| Discover agents by skill |
| Send task to peer by ID |
| Send task by skill (anycast) |
| Get task status |
Transport modes:
stdio -- for local AI tool integration (Claude Desktop, Cursor, VS Code, Gemini CLI, JetBrains)
Streamable HTTP -- for remote clients (ChatGPT)
MCP Remote Proxy
Wrap any MCP Server as a P2P-accessible agent with a single flag:
./agentanycastd --mcp-proxy "npx -y @modelcontextprotocol/server-filesystem /home/user"The proxy auto-generates an Agent Card from the MCP server's tool list, registers skills with the relay, and bridges incoming A2A tasks to MCP tool calls.
HTTP Bridge
Exposes an A2A-compatible HTTP endpoint for P2P ↔ HTTP interop:
GET /.well-known/a2a-agent-card-- Agent Card discoveryPOST /-- JSON-RPC endpoint for task operationsOptional TLS and CORS support
ANP Bridge
Exposes an ANP-compatible HTTP endpoint for Agent Network Protocol interop:
GET /agent/ad.json-- Agent Description (JSON-LD)GET /agent/interface.json-- OpenRPC specificationPOST /agent/rpc-- JSON-RPC 2.0 endpoint
Observability
Prometheus Metrics
Available on a configurable HTTP port (default :9090):
Metric | Type | Description |
| Gauge | Current peer count |
| Counter | Connection events by direction |
| Counter | Connections by transport (tcp/quic/webtransport) |
| Counter | Tasks by direction and status |
| Histogram | Task latency |
| Counter | Anycast resolution by result |
| Counter | HTTP bridge requests |
| Counter | Streaming chunks by direction |
| Counter | A2A messages by envelope type |
| Gauge | Queued offline messages |
| Counter | MCP tool calls by tool and status |
| Counter | ACL allow/deny decisions |
| Counter | Rate-limited requests |
OpenTelemetry
Distributed tracing with W3C Trace Context propagation. Spans cover task lifecycle, transport hops, and envelope encryption.
./agentanycastd --otlp-endpoint localhost:4317Building
make build # Build agentanycastd binary -> bin/
make test # Run all tests (unit + integration, -race)
make test-unit # Unit tests only (-short)
make test-integration # Integration tests only
make lint # golangci-lint
make cross-compile # Build for darwin/linux x amd64/arm64 + windows/amd64Disclaimer
This software is provided "as is", without warranty of any kind. This software uses cryptography and may be subject to export controls in certain jurisdictions.
License
FSL-1.1-ALv2 -- Functional Source License, Version 1.1, with Apache License, Version 2.0 as the future license. Each release converts to Apache 2.0 two years after its publication date.
This server cannot be installed
Maintenance
Latest Blog Posts
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/AgentAnycast/agentanycast-node'
If you have feedback or need assistance with the MCP directory API, please join our Discord server