Skip to content

Latest commit

ย 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

English | ไธญๆ–‡

๐ŸŒ‰ OpenClaw A2A Bridge

Python 3.11+ License: MIT A2A Protocol OpenClaw

Cross-device Agent-to-Agent communication bridge for OpenClaw, powered by Google's A2A Protocol.

Your AI agents shouldn't be islands. This bridge lets them talk to each other โ€” across devices, across networks, speaking a standard protocol.


Why This Project?

AI agents are powerful individually, but collaboration unlocks their real potential. The problem? Most agent frameworks trap agents in single-machine silos.

OpenClaw A2A Bridge solves this by implementing Google's A2A protocol โ€” the emerging standard for agent interoperability โ€” on top of OpenClaw's powerful agent runtime. Now your agents can:

  • ๐Ÿ” Discover each other's capabilities automatically
  • ๐Ÿ’ฌ Communicate via a standard JSON-RPC protocol
  • ๐ŸŒ Collaborate across devices on your Tailscale network (or any network)
  • ๐Ÿ”„ Stream responses in real-time via SSE

Features

Feature Description
A2A Protocol Compliance Full implementation of Agent Card discovery, JSON-RPC 2.0 messaging, and SSE streaming
OpenClaw Integration Wraps any OpenClaw agent as an A2A-compliant service via the OpenResponses API
Cross-Device Designed for multi-machine setups with Tailscale, but works on any network
Zero Config Discovery Agents self-describe via /.well-known/agent.json โ€” no registry needed
Traffic Logging All A2A traffic logged with rotation for debugging and monitoring
Health Checks Built-in health check for all components (server, agent card, API)
Auto-Start LaunchAgent (macOS) and systemd (Linux) support included
Interactive Client CLI client with discovery, one-shot, streaming, and interactive modes

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          A2A Protocol          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚    Device A           โ”‚       (JSON-RPC / HTTP)        โ”‚    Device B           โ”‚
โ”‚                       โ”‚                                โ”‚                       โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚  โ—„โ”€โ”€โ”€โ”€โ”€ Tailscale / LAN โ”€โ”€โ”€โ”€โ–บ โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  A2A Server      โ”‚  โ”‚         or any network        โ”‚  โ”‚  A2A Server      โ”‚  โ”‚
โ”‚  โ”‚  (port 9100)     โ”‚  โ”‚                                โ”‚  โ”‚  (port 9100)     โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚                                โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚           โ”‚            โ”‚                                โ”‚           โ”‚            โ”‚
โ”‚           โ–ผ            โ”‚                                โ”‚           โ–ผ            โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚                                โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  OpenResponses   โ”‚  โ”‚                                โ”‚  โ”‚  OpenResponses   โ”‚  โ”‚
โ”‚  โ”‚  Adapter         โ”‚  โ”‚                                โ”‚  โ”‚  Adapter         โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚                                โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚           โ”‚            โ”‚                                โ”‚           โ”‚            โ”‚
โ”‚           โ–ผ            โ”‚                                โ”‚           โ–ผ            โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚                                โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  OpenClaw Agent  โ”‚  โ”‚                                โ”‚  โ”‚  OpenClaw Agent  โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚                                โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿค– Just Tell Your Agent (Recommended)

The easiest way to set up A2A Bridge? Just send this message to your OpenClaw agent:

Send one of the following messages to your OpenClaw agent. It will read the full install document, then handle everything โ€” environment detection, dependencies, configuration, verification, auto-start, and remote agent connection.

Single Agent Setup

Read https://raw.githubusercontent.com/Shy-Plus/openclaw-a2a-bridge/main/INSTALL_PROMPT.en.md and follow every instruction in it. Complete all 7 phases. Do not skip any step.

Connect Two Agents

Agent A is already running? Send this to Agent B:

Read https://raw.githubusercontent.com/Shy-Plus/openclaw-a2a-bridge/main/INSTALL_PROMPT.en.md and follow every instruction. After setup, connect to the remote agent at http://{Agent A's IP}:9100 โ€” discover it and send a test message.

Multi-Agent Network

For 3+ agents, send to each new agent:

Read https://raw.githubusercontent.com/Shy-Plus/openclaw-a2a-bridge/main/INSTALL_PROMPT.en.md and follow every instruction. After setup, discover and connect to all known agents: {list their IPs}. Send a hello to each one.

ไธญๆ–‡็‰ˆ / Chinese:

้˜…่ฏป https://raw.githubusercontent.com/Shy-Plus/openclaw-a2a-bridge/main/INSTALL_PROMPT.md ๅนถไธฅๆ ผๆŒ‰็…งๆ–‡ๆกฃไธญ็š„ๆฏไธ€ๆญฅๆ‰ง่กŒใ€‚ๅฎŒๆˆๅ…จ้ƒจ 7 ไธช้˜ถๆฎต๏ผŒไธ่ฆ่ทณ่ฟ‡ไปปไฝ•ๆญฅ้ชคใ€‚


Quick Start (Manual)

1. Install

git clone https://github.com/Shy-Plus/openclaw-a2a-bridge.git
cd openclaw-a2a-bridge
pip install -r requirements.txt

2. Configure

cp .env.example .env
# Edit .env โ€” at minimum, set A2A_PUBLIC_URL to your machine's IP

3. Run

# Start the server
./scripts/run_server.sh

# Or directly:
python -m src.server --port 9100 --public-url http://YOUR_IP:9100

That's it. Your agent is now discoverable via A2A at http://YOUR_IP:9100/.well-known/agent.json.

Usage

Discover a remote agent

python -m src.client --target http://remote-agent:9100 --discover-only
๐Ÿค– Agent: Remote Agent
   Version: 1.0.0
   Skills (3):
     โ€ข General Conversation: Engage in natural conversation
     โ€ข Creative Assistant: Help with creative tasks
     โ€ข Frontend Development: React, Next.js, CSS, UI/UX

Send a message

python -m src.client --target http://remote-agent:9100 -m "Explain the A2A protocol"

Interactive chat

python -m src.client --target http://remote-agent:9100

Streaming mode

python -m src.client --target http://remote-agent:9100 -m "Tell me a story" --stream

Health check

python -m src.health_check --url http://localhost:9100
โœ… http://localhost:9100 โ€” HEALTHY
   โœ… A2A Server: 12ms
   โœ… Agent Card: 8ms โ€” My Agent v1.0.0 (3 skills)
   โœ… OpenResponses API: 45ms

Run the collaboration demo

# Start servers on both machines first, then:
python examples/demo.py --local http://agent-a:9100 --remote http://agent-b:9100

Configuration

Environment Variables

Variable Default Description
A2A_GATEWAY_TOKEN Auto-detect from openclaw.json Gateway shared auth credential (token or password)

Note: if your OpenClaw gateway uses gateway.auth.mode="password", the bridge now auto-detects gateway.auth.password from ~/.openclaw/openclaw.json when A2A_GATEWAY_TOKEN is not set. | A2A_LOCAL_HOST | 0.0.0.0 | Server bind address | | A2A_LOCAL_PORT | 9100 | Server port | | A2A_LOCAL_API | http://localhost:18789/v1/responses | OpenResponses API URL | | A2A_PUBLIC_URL | http://{host}:{port} | URL advertised in Agent Card | | A2A_REMOTE_HOST | โ€” | Remote agent IP (for multi-agent) | | A2A_REMOTE_PORT | 9100 | Remote agent port | | A2A_MODEL | openclaw:main | Model for OpenResponses API | | A2A_AGENT_CARD | cards/agent_card.json | Agent card file path | | A2A_TRAFFIC_LOG | ~/.openclaw/logs/a2a-traffic.log | Traffic log path |

Agent Card

The Agent Card (cards/agent_card.json) defines your agent's identity and capabilities. Customize it to describe what your agent can do:

{
  "name": "My Agent",
  "description": "What this agent does",
  "skills": [
    {
      "id": "skill_id",
      "name": "Skill Name",
      "description": "What this skill does",
      "tags": ["tag1"],
      "examples": ["Example prompt"]
    }
  ]
}

A2A Protocol Compliance

A2A Feature Status Notes
Agent Card (Discovery) โœ… GET /.well-known/agent.json
JSON-RPC 2.0 โœ… Full request/response cycle
Synchronous messaging โœ… Standard request โ†’ response
SSE Streaming โœ… Real-time token streaming
Multi-skill declaration โœ… Via Agent Card skills array
Bearer Token Auth โœ… For OpenResponses API
Task management โœ… In-memory task store

Project Structure

openclaw-a2a-bridge/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ __init__.py          # Package init
โ”‚   โ”œโ”€โ”€ server.py            # A2A server (Starlette + uvicorn)
โ”‚   โ”œโ”€โ”€ client.py            # A2A client (discovery + messaging)
โ”‚   โ”œโ”€โ”€ adapter.py           # OpenResponses โ†” A2A bridge
โ”‚   โ”œโ”€โ”€ config.py            # Centralized configuration
โ”‚   โ””โ”€โ”€ health_check.py      # Component health checker
โ”œโ”€โ”€ cards/
โ”‚   โ”œโ”€โ”€ agent_card.json      # Primary agent card (customize this)
โ”‚   โ””โ”€โ”€ remote_agent_card.json # Example remote agent card
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ run_server.sh        # Start/stop/restart/status
โ”‚   โ””โ”€โ”€ install_service.sh   # macOS LaunchAgent installer
โ”œโ”€โ”€ examples/
โ”‚   โ”œโ”€โ”€ demo.py              # Multi-agent collaboration demo
โ”‚   โ””โ”€โ”€ collaborative_workflow.py  # Pipeline workflow example
โ”œโ”€โ”€ docs/
โ”‚   โ”œโ”€โ”€ architecture.md      # Detailed architecture docs
โ”‚   โ”œโ”€โ”€ setup-guide.md       # Step-by-step setup guide
โ”‚   โ””โ”€โ”€ troubleshooting.md   # Common issues & solutions
โ”œโ”€โ”€ .env.example             # Environment variable template
โ”œโ”€โ”€ requirements.txt         # Python dependencies
โ”œโ”€โ”€ setup.py                 # pip install support
โ””โ”€โ”€ LICENSE                  # MIT License

Auto-Start

macOS (LaunchAgent)

./scripts/install_service.sh          # Install
./scripts/install_service.sh --uninstall  # Remove

Linux (systemd)

See docs/setup-guide.md for systemd setup.

Contributing

Contributions welcome! Here's how:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feat/my-feature
  3. Commit changes: git commit -m "feat: add my feature"
  4. Push: git push origin feat/my-feature
  5. Open a Pull Request

Please follow Conventional Commits for commit messages.

License

MIT License โ€” use it however you want.

Credits

  • Google A2A Protocol โ€” The Agent-to-Agent protocol specification
  • a2a-sdk โ€” Official Python SDK for A2A
  • OpenClaw โ€” The AI agent runtime this bridge extends
  • Tailscale โ€” Mesh VPN for secure cross-device connectivity

Built by Shy's Lab ๐Ÿช
Making agents talk to each other, one bridge at a time.

About

Cross-device Agent-to-Agent communication bridge for OpenClaw, powered by Google A2A Protocol

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages