AgentAnycast Node MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
go build -o agentanycastd ./cmd/agentanycastd
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add agentanycast-node -- node "<FULL_PATH_TO_AGENTANYCAST_NODE>/dist/index.js"

Replace <FULL_PATH_TO_AGENTANYCAST_NODE>/dist/index.js with the actual folder you prepared in step 1.

README.md

The core daemon powering AgentAnycast's P2P agent network.

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 (did:key, did:web, did:dns), skill-based ACL, per-peer rate limiting
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 mDNS

With Python SDK

pip install agentanycast
from 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 :3000

Cross-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
-key Path to identity key file
-grpc-listen gRPC listen address (unix:// or tcp://)
-log-level Log level (debug, info, warn, error)
-bootstrap-peers Comma-separated bootstrap multiaddrs
-bridge-listen HTTP bridge listen address (e.g., :8080)
-enable-webtransport Enable WebTransport (QUIC-based, browser-compatible)
-mcp Run as MCP server over stdio
-mcp-listen MCP Streamable HTTP listen address (e.g., :3000)
-mcp-proxy Wrap an MCP Server command as a P2P-accessible agent
-anp-listen ANP bridge listen address (e.g., :8090)
-nats-broker NATS broker URL (e.g., nats://broker.example.com:4222)
-otlp-endpoint OTLP collector endpoint for distributed tracing
-metrics-listen Prometheus metrics listen address (e.g., :9090)
-config Path to TOML config file
-version Print version and exit

Environment Variables

Variable Default
AGENTANYCAST_KEY_PATH ~/.agentanycast/key
AGENTANYCAST_GRPC_LISTEN unix://~/.agentanycast/daemon.sock
AGENTANYCAST_LOG_LEVEL info
AGENTANYCAST_STORE_PATH ~/.agentanycast/data
AGENTANYCAST_BOOTSTRAP_PEERS (none)
AGENTANYCAST_ENABLE_MDNS true
AGENTANYCAST_REGISTRY_ADDRS (none)
AGENTANYCAST_MCP_LISTEN (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_mod

Tools (1)

mcp-proxyWraps an existing MCP server as a P2P-accessible agent.

Environment Variables

AGENTANYCAST_KEY_PATHPath to identity key file
AGENTANYCAST_GRPC_LISTENgRPC listen address
AGENTANYCAST_LOG_LEVELLog level (debug, info, warn, error)
AGENTANYCAST_STORE_PATHPath to data storage
AGENTANYCAST_BOOTSTRAP_PEERSComma-separated bootstrap multiaddrs
AGENTANYCAST_ENABLE_MDNSEnable mDNS discovery
AGENTANYCAST_MCP_LISTENMCP Streamable HTTP listen address

Configuration

claude_desktop_config.json
{"mcpServers": {"agentanycast": {"command": "agentanycastd", "args": ["-mcp"]}}}

Try it

Connect to the local P2P network and discover available agents on my LAN.
Wrap my local file-system MCP server as a P2P-accessible agent using the proxy tool.
Send a task to the 'translate' agent on the network to translate the current document.
Check the status of my P2P node and list all currently connected peers.

Frequently Asked Questions

What are the key features of AgentAnycast Node?

Zero-config mDNS auto-discovery for local network agents. End-to-end NaCl box encryption for secure agent communication. Supports multiple addressing modes including direct, anycast, and HTTP bridge. MCP Server mode for integration with Claude Desktop and other AI clients. Built-in NAT traversal using AutoNAT, DCUtR, and Circuit Relay v2.

What can I use AgentAnycast Node for?

Enabling secure, decentralized communication between AI agents across different machines. Exposing local MCP tools to remote AI clients via a secure P2P relay. Building cross-network agent workflows that require offline message queuing. Deploying private AI agent networks on local infrastructure without cloud dependencies.

How do I install AgentAnycast Node?

Install AgentAnycast Node by running: go build -o agentanycastd ./cmd/agentanycastd

What MCP clients work with AgentAnycast Node?

AgentAnycast Node works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep AgentAnycast Node docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare