AgentAnycast

io.github.AgentAnycast由 GitHub 帳號 AgentAnycast 發布v0.3.2更新於 Oct 24, 2026

P2P runtime for A2A protocol. Encrypted agent communication with zero-config NAT traversal.

概覽

AI 產生的概覽

點對點代理網路守護程式,把 A2A 任務傳送、代理探索與節點檢視能力以 MCP 工具形式提供給 AI 助理。

可以做什麼
  • 檢視本機節點資訊、代理卡片與已連線的對等節點
  • 依技能探索代理,取得本機或遠端代理卡片
  • 依節點 ID 或依技能(anycast)傳送任務並查詢任務狀態
  • 以 stdio 或 Streamable HTTP 方式作為 MCP 伺服器執行,並可將其他 MCP 伺服器指令包裝成 P2P 可存取的代理
適用情境
當你希望助理透過加密的點對點網路把工作交給其他代理時使用:同一區域網路內零設定即可,跨網路則需自建中繼。
執行需求
需在本機執行守護程式二進位檔(agentanycastd)並以 MCP 模式啟動,或使用 npm 套件;需要身分金鑰檔案(預設位於使用者家目錄下)與本機資料存放區;跨網路使用需中繼或引導節點;可選的 Python、TypeScript SDK 透過 gRPC 與其通訊。
安裝前請注意
守護程式保存身分金鑰檔案並使用密碼學,README 提示可能受某些司法管轄區的出口管制。傳送任務會把工作派送給遠端對等節點,MCP 代理會把另一個 MCP 伺服器的工具暴露到 P2P 網路。可選的 HTTP 橋接、ANP 橋接、指標與 OTLP 端點會開放網路監聽埠,應加以保護。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 AgentAnycast,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

AgentAnycast Node

The core daemon powering AgentAnycast's P2P agent network.

[CI] [Go] [License]

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

CategoryCapabilities
Networkinglibp2p (TCP, QUIC, WebTransport), NATS transport, mDNS auto-discovery, NAT traversal (AutoNAT + DCUtR + Circuit Relay v2)
SecurityE2E NaCl box encryption (X25519 + XSalsa20-Poly1305), W3C DID identity (did:key, did:web, did:dns), skill-based ACL, per-peer rate limiting
A2A ProtocolTask state machine, 3 addressing modes (direct / anycast / HTTP bridge), streaming artifacts, offline message queue
InteropHTTP Bridge (P2P ↔ HTTP A2A), ANP Bridge (Agent Network Protocol), MCP Server (stdio + Streamable HTTP)
EnterpriseAudit logging (JSON Lines), Prometheus metrics, OpenTelemetry tracing (W3C Trace Context, OTLP)
AI ToolsMCP Server for 13+ AI platforms, MCP Remote Proxy to wrap any MCP Server as a P2P agent

Quick Start

Standalone -- local network (zero configuration)

bash
go build -o agentanycastd ./cmd/agentanycastd./agentanycastd# Agents on the same LAN discover each other automatically via mDNS

With Python SDK

bash
pip install agentanycast
python
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

bash
# 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

bash
# On any VPS with a public IPgit clone https://github.com/AgentAnycast/agentanycast-relay && cd agentanycast-relaydocker-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

FlagDescription
-keyPath to identity key file
-grpc-listengRPC listen address (unix:// or tcp://)
-log-levelLog level (debug, info, warn, error)
-bootstrap-peersComma-separated bootstrap multiaddrs
-bridge-listenHTTP bridge listen address (e.g., :8080)
-enable-webtransportEnable WebTransport (QUIC-based, browser-compatible)
-mcpRun as MCP server over stdio
-mcp-listenMCP Streamable HTTP listen address (e.g., :3000)
-mcp-proxyWrap an MCP Server command as a P2P-accessible agent
-anp-listenANP bridge listen address (e.g., :8090)
-nats-brokerNATS broker URL (e.g., nats://broker.example.com:4222)
-otlp-endpointOTLP collector endpoint for distributed tracing
-metrics-listenPrometheus metrics listen address (e.g., :9090)
-configPath to TOML config file
-versionPrint version and exit

Environment Variables

VariableDefault
AGENTANYCAST_KEY_PATH~/.agentanycast/key
AGENTANYCAST_GRPC_LISTENunix://~/.agentanycast/daemon.sock
AGENTANYCAST_LOG_LEVELinfo
AGENTANYCAST_STORE_PATH~/.agentanycast/data
AGENTANYCAST_BOOTSTRAP_PEERS(none)
AGENTANYCAST_ENABLE_MDNStrue
AGENTANYCAST_REGISTRY_ADDRS(none)
AGENTANYCAST_MCP_LISTEN(none)

Config File

Default location: ~/.agentanycast/config.toml

toml
key_path = "~/.agentanycast/key"grpc_listen = "unix://~/.agentanycast/daemon.sock"log_level = "info"log_format = "json"store_path = "~/.agentanycast/data"enable_mdns = trueenable_quic = trueenable_webtransport = falseenable_relay_client = trueenable_hole_punching = trueoffline_queue_ttl = "24h"bootstrap_peers = ["/ip4/203.0.113.50/tcp/4001/p2p/12D3KooW..."]
[bridge]enabled = falselisten = ":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"]  # federationenable_dht = falsedht_mode = "auto"   # "auto", "server", or "client"
[metrics]enabled = falselisten = ":9090"
[mcp]enabled = falselisten = ":3000"
[anp]enabled = falselisten = ":8090"
# NATS Transport[transport.nats]enabled = truebroker = "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 = falseotlp_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

PackageResponsibility
internal/a2a/A2A protocol engine -- task state machine, envelope routing, offline queue, streaming
internal/node/libp2p host -- peer connections, mDNS, DHT, TCP/QUIC/WebTransport
internal/crypto/Ed25519 keys, DID conversion (did:key, did:web, did:dns), Verifiable Credentials
internal/nat/AutoNAT, DCUtR hole punching, Circuit Relay v2 client
internal/store/BoltDB persistence -- tasks, agent cards, offline queue
internal/config/TOML config, environment variables, CLI flags
internal/envelope/Protocol-neutral message routing, E2E NaCl box encryption
internal/transport/Pluggable transport adapters -- libp2p, NATS, HTTP bridge
internal/bridge/HTTP Bridge -- translates HTTP JSON-RPC ↔ P2P A2A envelopes
internal/anycast/Anycast router -- skill-based addressing, multi-registry federation, DHT discovery
internal/mcp/MCP Server -- P2P capabilities as MCP tools (stdio + Streamable HTTP)
internal/mcpproxy/MCP Remote Proxy -- wraps external MCP commands as P2P agents
internal/anp/ANP Bridge -- translates ANP HTTP ↔ A2A P2P (JSON-RPC 2.0 + JSON-LD)
internal/policy/Enterprise policy -- skill-based ACL, per-peer rate limiting, audit logging
internal/metrics/Prometheus metrics -- connections, tasks, routing, bridge, streaming, MCP
internal/otel/OpenTelemetry -- distributed tracing, W3C Trace Context, OTLP exporter
pkg/grpcserver/gRPC server -- 16 RPC methods for SDKs

gRPC API

GroupMethods
NodeGetNodeInfo, SetAgentCard
PeersConnectPeer, ListPeers, GetPeerCard
Task ClientSendTask (peer_id / skill_id / url), GetTask, CancelTask, SubscribeTaskUpdates
Task ServerSubscribeIncomingTasks, UpdateTaskStatus, CompleteTask, FailTask
StreamingSubscribeTaskStream, SendStreamingArtifact
DiscoveryDiscover

MCP Server

The daemon can run as an MCP (Model Context Protocol) server, exposing P2P capabilities as tools for AI assistants.

ToolDescription
toolGetNodeInfoGet local node information
toolListConnectedPeersList connected peers
toolGetAgentCardGet local or remote agent card
toolDiscoverAgentsDiscover agents by skill
toolSendTaskSend task to peer by ID
toolSendTaskBySkillSend task by skill (anycast)
toolGetTaskStatusGet 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:

bash
./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 discovery
  • POST / -- JSON-RPC endpoint for task operations
  • Optional 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 specification
  • POST /agent/rpc -- JSON-RPC 2.0 endpoint

Observability

Prometheus Metrics

Available on a configurable HTTP port (default :9090):

MetricTypeDescription
agentanycast_connected_peersGaugeCurrent peer count
agentanycast_connections_totalCounterConnection events by direction
agentanycast_connections_by_transportCounterConnections by transport (tcp/quic/webtransport)
agentanycast_tasks_totalCounterTasks by direction and status
agentanycast_task_duration_secondsHistogramTask latency
agentanycast_route_resolutions_totalCounterAnycast resolution by result
agentanycast_bridge_requests_totalCounterHTTP bridge requests
agentanycast_stream_chunks_totalCounterStreaming chunks by direction
agentanycast_messages_totalCounterA2A messages by envelope type
agentanycast_offline_queue_sizeGaugeQueued offline messages
agentanycast_mcp_tool_calls_totalCounterMCP tool calls by tool and status
agentanycast_acl_decisions_totalCounterACL allow/deny decisions
agentanycast_rate_limit_rejections_totalCounterRate-limited requests

OpenTelemetry

Distributed tracing with W3C Trace Context propagation. Spans cover task lifecycle, transport hops, and envelope encryption.

bash
./agentanycastd --otlp-endpoint localhost:4317

Building

bash
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 onlymake lint               # golangci-lintmake cross-compile      # Build for darwin/linux x amd64/arm64 + windows/amd64

Disclaimer

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.

來源:README.md,提交 a09660a

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.3.2最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。