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
|
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.
1
| openclaw gateway restart
|
3. Register the Plugin
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
|
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":"้ๅฏน่็นใ้็พคใ่ด่ฝฝ็ๅผๅธธ่ฏๆญ"}]'
|
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.
1
| openclaw config set plugins.entries.a2a-gateway.config.routing.defaultAgentId 'main'
|
Uses main by default
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
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 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
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