OpenClaw A2A Gateway is a plugin for the OpenClaw assistant runtime that implements the Agent-to-Agent (A2A) protocol, version 0.3.0. Once loaded, an OpenClaw instance publishes an Agent Card at /.well-known/agent-card.json, accepts inbound A2A messages, and can send messages to peer agents on other servers over Tailscale, a LAN, or a public IP.
The gateway is bidirectional. Inbound messages arrive over JSON-RPC, REST, or gRPC and are dispatched to a configured OpenClaw agent; outbound calls run through a bundled a2a-send.mjs script or an a2asendfile agent tool, with the transport chosen automatically (JSON-RPC, then REST, then gRPC). Peers are declared in the plugin config with an Agent Card URL and a bearer token, or discovered through DNS-SD a2a.tcp records, and long prompts can run as non-blocking tasks that a caller polls with tasks/get.
Inbound TextPart, FilePart, and DataPart payloads are serialized to text before reaching the agent, because the OpenClaw Gateway RPC accepts plain text only. In the other direction, mediaUrl fields and file links in the agent's reply are promoted to FilePart entries. A non-standard message.agentId field lets a caller target a specific OpenClaw agent on the peer; this extension works over JSON-RPC and REST, while gRPC may drop unknown message fields. The plugin requires OpenClaw 2026.3.0 or later and Node.js 22 or later.
Features
- Three transports: JSON-RPC, REST, and gRPC with automatic fallback, plus server-sent events (SSE) streaming with heartbeat keep-alive for task status
- Peer discovery: DNS-SD lookup of a2a.tcp SRV and TXT records, mDNS self-advertisement, and density-aware polling intervals with hysteresis
- Routing rules: peer selection by message pattern, tags, or skills cached from peer Agent Cards, scored with a Hill-equation affinity function
- Resilience: a four-state circuit breaker, per-transport success-rate and latency tracking, and a progressive concurrency delay ahead of the hard queue limit
- Push notifications: webhook delivery with importance decay and decay-aware retry
- Security controls: bearer-token authentication with multi-token rotation, SSRF protection through hostname and MIME allowlists and file-size limits, and Ed25519 device identity for OpenClaw 2026.3.13 or later
- Observability: a JSONL audit trail of A2A calls and security events, and a telemetry metrics endpoint with optional bearer auth
- Durable task store: tasks persist on disk with TTL cleanup and concurrency limits
- Agent runtime awareness: a TOOLS.md template tells the LLM agent how to call peers, so outbound A2A calls are not left to inference
