It wraps the opencode serve engine with a standard FastAPI-based A2A interface.
90
A2A-Opencode is a production-ready Agent-to-Agent (A2A) protocol gateway container for the opencode autonomous coding agent.
It wraps the headless opencode serve engine with a standard FastAPI-based A2A interface (JSON-RPC 2.0 and Agent Card discovery), enabling seamless collaboration in multi-agent workforce environments.
/.well-known/agent-card.json metadata discovery and JSON-RPC 2.0 endpoints (sendMessage, ping).opencode serve engine (127.0.0.1:4096).A2A_TOKEN) for incoming client/agent requests.OPENCODE_SERVER_PASSWORD) to protect the headless engine.opencode serve and the FastAPI A2A gateway with an automated orchestration lifecycle and healthcheck.uv dependency caching on top of Ubuntu 24.04 LTS (Noble) base. +--------------------------------------------------------+
| Docker Container (Port 8000) |
| |
[ A2A Client / Agent ] ---> [ FastAPI A2A Gateway ] (0.0.0.0:8000) |
(JSON-RPC 2.0) | | |
| | (Internal async HTTP / Basic Auth) |
| v |
| [ opencode serve Backend ] (127.0.0.1:4096) |
+--------------------------------------------------------+
docker run -d \
--name a2a-opencode \
-p 8000:8000 \
-e OPENCODE_SERVER_PASSWORD=your_secure_password \
-e A2A_TOKEN=your_optional_bearer_token \
opsmaster/a2a-opencode:v1.0
Create a docker-compose.yml file:
version: '3.8'
services:
a2a-opencode:
image: opsmaster/a2a-opencode:v1.0
container_name: a2a-opencode
ports:
- "8000:8000"
environment:
- OPENCODE_SERVER_PASSWORD=your_secure_password
- A2A_TOKEN=your_optional_bearer_token
restart: unless-stopped
Start the container:
docker compose up -d
| Variable | Required | Default | Description |
|---|---|---|---|
OPENCODE_SERVER_PASSWORD | Yes | - | Password used for authenticating with the internal opencode serve instance. |
A2A_TOKEN | No | - | Bearer token for authenticating inbound A2A requests from external clients/agents. |
A2A_PORT | No | 8000 | Gateway listening port. |
A2A_HOST | No | 0.0.0.0 | Gateway bind host. |
Retrieve agent capabilities, supported protocols, and metadata:
curl -X GET http://localhost:8000/.well-known/agent-card.json
curl -X GET http://localhost:8000/health
curl -X POST http://localhost:8000/ \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your_optional_bearer_token" \
-d '{
"jsonrpc": "2.0",
"method": "sendMessage",
"params": {
"message": "Analyze and refactor the user authentication module in src/auth.py"
},
"id": 1
}'
This project is licensed under the MIT License.
Content type
Image
Digest
sha256:52d25b30a…
Size
502.7 MB
Last updated
19 days ago
docker pull opsmaster/a2a-opencode:v1.0