This page looks best with JavaScript enabled

Using A2A Gateway to Connect Multiple OpenClaw

 ·  โ˜• 2 min read

1. Architecture

1
2
3
4
5
6
7
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         A2A/JSON-RPC          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   OpenClaw Server A  โ”‚ โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ  โ”‚   OpenClaw Server B  โ”‚
โ”‚                      โ”‚    (Tailscale / intranet)     โ”‚                      โ”‚
โ”‚  Agent: AGI          โ”‚                               โ”‚  Agent: Coco         โ”‚
โ”‚  A2A Port: 18800     โ”‚                               โ”‚  A2A Port: 18800     โ”‚
โ”‚  Peer: Server-B      โ”‚                               โ”‚  Peer: Server-A      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Requirements:

  • OpenClaw โ‰ฅ 2026.3.0 installed and running
  • Network connectivity between the OpenClaw instances
  • Node.js โ‰ฅ 22

2. Installation

  • Download to the local plugin directory
1
2
3
4
5
mkdir -p ~/.openclaw/workspace/plugins
cd ~/.openclaw/workspace/plugins
git clone https://github.com/win4r/openclaw-a2a-gateway.git a2a-gateway
cd a2a-gateway
npm install --production
  • Force install
1
openclaw plugins install ~/.openclaw/workspace/plugins/a2a-gateway --dangerously-force-unsafe-install 

The flag that bypasses the safety check differs between OpenClaw versions; check the --help output.

  • Restart the service
1
openclaw gateway restart

3. Register the Plugin

  • View the plugin list
1
openclaw config get plugins.allow
  • Add the new plugin to the list
1
2
3
4
5
openclaw config set plugins.allow '["a2a-gateway"]'

openclaw config set plugins.load.paths '["/root/.openclaw/workspace/plugins/a2a-gateway"]'

openclaw config set plugins.entries.a2a-gateway.enabled true

4. Configure the Agent

  • Configure the Agent Card

Configure the information required for the current Agent

1
2
3
4
openclaw config set plugins.entries.a2a-gateway.config.agentCard.name 'Ops-Copilot'
openclaw config set plugins.entries.a2a-gateway.config.agentCard.description 'ๆ™บ่ƒฝ่ฟ็ปดๅŠฉๆ‰‹'
openclaw config set plugins.entries.a2a-gateway.config.agentCard.url 'http://1.1.1.1:18800/a2a/jsonrpc'
openclaw config set plugins.entries.a2a-gateway.config.agentCard.skills '[{"id":"ops-doctor","name":"่ฟ็ปด่ฏŠๆ–ญ","description":"้’ˆๅฏน่Š‚็‚นใ€้›†็พคใ€่ดŸ่ฝฝ็š„ๅผ‚ๅธธ่ฏŠๆ–ญ"}]'
  • Configure the A2A server
1
2
openclaw config set plugins.entries.a2a-gateway.config.server.host '0.0.0.0'
openclaw config set plugins.entries.a2a-gateway.config.server.port 18800
  • Configure security authentication

Generate an inbound authentication Token:

1
2
TOKEN=$(openssl rand -hex 24)
echo "A2A Token: $TOKEN"
1
2
openclaw config set plugins.entries.a2a-gateway.config.security.inboundAuth 'bearer'
openclaw config set plugins.entries.a2a-gateway.config.security.token "$TOKEN"

This TOKEN is used to authenticate other Agents when they connect.

  • Configure Agent routing
1
openclaw config set plugins.entries.a2a-gateway.config.routing.defaultAgentId 'main'

Uses main by default

  • Restart the gateway
1
openclaw gateway restart
  • Verify the agent-card information
1
curl -s http://localhost:18800/.well-known/agent-card.json | python3 -m json.tool
  • Verify the agent can receive calls from other agents
1
2
3
4
node /home/kas/.openclaw/workspace/plugins/a2a-gateway/skill/scripts/a2a-send.mjs \
  --peer-url http://x.x.x.x:18800 \
  --token xxx \
  --message "ไฝ ๅฅฝ๏ผŒๆฅ่‡ชๅค–้ƒจ่ฐƒ็”จ็š„ๆถˆๆฏ"

In fact, when another agent invokes this one, it uses the same method.

5. Configuring Other Agents

  • Install A2A Gateway

Refer to the steps above

  • Configure the Agent to use
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
openclaw config set plugins.entries.a2a-gateway.config.peers '[
  {
    "name": "ops-copilot",
    "agentCardUrl": "http://1.1.1.1:18800/.well-known/agent-card.json",
    "auth": {
      "type": "bearer",
      "token": "xxxxxxxxxxx"
    }
  }
]'
  • Add TOOLS

Add the following content to workspace/TOOLS.md to tell OpenClaw how to use it.

https://raw.githubusercontent.com/win4r/openclaw-a2a-gateway/refs/heads/master/skill/references/tools-md-template.md

  • Test it
1
openclaw agent --agent main -m "้€š่ฟ‡ A2A ่ฎฉ ops-copilot ๆŸฅไธ€ไธ‹้›†็พค็Šถๆ€"

At this point, a processing request is sent to the other agent.

6. References

https://github.com/win4r/openclaw-a2a-gateway/issues/53
https://github.com/win4r/openclaw-a2a-gateway/blob/master/README_CN.md#3-้…็ฝฎ-agent-card


ๅพฎไฟกๅ…ฌไผ—ๅท
WRITTEN BY
ๅพฎไฟกๅ…ฌไผ—ๅท