A2A wrapper service for opencode
Project description
opencode-a2a-server
Expose OpenCode through A2A.
opencode-a2a-server adds an A2A service layer to opencode serve, with
auth, streaming, session continuity, interrupt handling, and a clear
deployment boundary.
What This Is
- An A2A adapter service for
opencode serve. - Use it when you need a stable A2A endpoint for apps, gateways, or A2A clients.
flowchart TD
Client["a2a-client-hub / any A2A client"]
subgraph ServerSide["Server-side"]
Adapter["opencode-a2a-server\nA2A adapter service"]
Runtime["opencode serve\nOpenCode runtime"]
Adapter <--> Runtime
end
Client <--> Adapter
Quick Start
Install the released CLI with uv tool:
uv tool install opencode-a2a-server
Upgrade later with:
uv tool upgrade opencode-a2a-server
Make sure provider credentials and a default model are configured on the OpenCode side, then start OpenCode:
opencode auth login
opencode models
opencode serve --hostname 127.0.0.1 --port 4096
Then start opencode-a2a-server against that upstream:
A2A_BEARER_TOKEN=dev-token \
OPENCODE_BASE_URL=http://127.0.0.1:4096 \
A2A_HOST=127.0.0.1 \
A2A_PORT=8000 \
A2A_PUBLIC_URL=http://127.0.0.1:8000 \
OPENCODE_WORKSPACE_ROOT=/abs/path/to/workspace \
opencode-a2a-server serve
Verify that the service is up:
curl http://127.0.0.1:8000/.well-known/agent-card.json
Default local address: http://127.0.0.1:8000
What You Get
- A2A HTTP+JSON endpoints such as
/v1/message:sendand/v1/message:stream - A2A JSON-RPC support on
POST / - SSE streaming with normalized
text,reasoning, andtool_callblocks - Session continuity through
metadata.shared.session.id - Request-scoped model selection through
metadata.shared.model - OpenCode-oriented JSON-RPC extensions for session and model/provider queries
Detailed protocol contracts, examples, and extension docs live in
docs/guide.md.
When To Use It
Use this project when:
- you want to keep OpenCode as the runtime
- you need A2A transports and Agent Card discovery
- you want a thin service boundary instead of building your own adapter
Look elsewhere if:
- you need hard multi-tenant isolation inside one shared runtime
- you want this project to manage your process supervisor or host bootstrap
- you want a general client integration layer rather than a server wrapper
For client-side integration, prefer a2a-client-hub.
Deployment Boundary
This repository improves the service boundary around OpenCode, but it does not turn OpenCode into a hardened multi-tenant platform.
A2A_BEARER_TOKENprotects the A2A surface.- Provider auth and default model configuration remain on the OpenCode side.
- Deployment supervision is intentionally BYO. Use
systemd, Docker, Kubernetes, or another supervisor if you need long-running operation. - For mutually untrusted tenants, run separate instance pairs with isolated users, containers, workspaces, credentials, and ports.
Read before deployment:
Further Reading
- docs/guide.md Usage guide, transport details, streaming behavior, extensions, and examples.
- SECURITY.md Threat model, deployment caveats, and vulnerability disclosure guidance.
Development
For contributor workflow, local validation, and helper scripts, see CONTRIBUTING.md and scripts/README.md.
License
Apache-2.0. See LICENSE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opencode_a2a_server-0.2.4.tar.gz.
File metadata
- Download URL: opencode_a2a_server-0.2.4.tar.gz
- Upload date:
- Size: 175.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f90fead7dc72ab49ba9ebe64c9277752baa3f21dde390c17809ae0126d75004
|
|
| MD5 |
86106895daf0baf6e3fb57bc40922b2b
|
|
| BLAKE2b-256 |
07da69e6fa680e80d087bdecff076b45370a348b239d48f30c41643d6ef9e4c5
|
Provenance
The following attestation bundles were made for opencode_a2a_server-0.2.4.tar.gz:
Publisher:
publish.yml on Intelligent-Internet/opencode-a2a-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opencode_a2a_server-0.2.4.tar.gz -
Subject digest:
7f90fead7dc72ab49ba9ebe64c9277752baa3f21dde390c17809ae0126d75004 - Sigstore transparency entry: 1135292244
- Sigstore integration time:
-
Permalink:
Intelligent-Internet/opencode-a2a-server@05d188649c2a6d4da3ab396131308821938d2833 -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/Intelligent-Internet
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@05d188649c2a6d4da3ab396131308821938d2833 -
Trigger Event:
push
-
Statement type:
File details
Details for the file opencode_a2a_server-0.2.4-py3-none-any.whl.
File metadata
- Download URL: opencode_a2a_server-0.2.4-py3-none-any.whl
- Upload date:
- Size: 56.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
810174752911bcb4d59c596d2faf458f0bfb2effac7ccf34448525a779254a0b
|
|
| MD5 |
dde4d70e501b1413783171b7fbd13b31
|
|
| BLAKE2b-256 |
6a46f17a44f7ebc9f450e4523022d4c93de928b15ef19c792a43e82bb1ee8eea
|
Provenance
The following attestation bundles were made for opencode_a2a_server-0.2.4-py3-none-any.whl:
Publisher:
publish.yml on Intelligent-Internet/opencode-a2a-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opencode_a2a_server-0.2.4-py3-none-any.whl -
Subject digest:
810174752911bcb4d59c596d2faf458f0bfb2effac7ccf34448525a779254a0b - Sigstore transparency entry: 1135292313
- Sigstore integration time:
-
Permalink:
Intelligent-Internet/opencode-a2a-server@05d188649c2a6d4da3ab396131308821938d2833 -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/Intelligent-Internet
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@05d188649c2a6d4da3ab396131308821938d2833 -
Trigger Event:
push
-
Statement type: