Skip to main content

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:send and /v1/message:stream
  • A2A JSON-RPC support on POST /
  • SSE streaming with normalized text, reasoning, and tool_call blocks
  • 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_TOKEN protects 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

opencode_a2a_server-0.2.4.tar.gz (175.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opencode_a2a_server-0.2.4-py3-none-any.whl (56.4 kB view details)

Uploaded Python 3

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

Hashes for opencode_a2a_server-0.2.4.tar.gz
Algorithm Hash digest
SHA256 7f90fead7dc72ab49ba9ebe64c9277752baa3f21dde390c17809ae0126d75004
MD5 86106895daf0baf6e3fb57bc40922b2b
BLAKE2b-256 07da69e6fa680e80d087bdecff076b45370a348b239d48f30c41643d6ef9e4c5

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file opencode_a2a_server-0.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for opencode_a2a_server-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 810174752911bcb4d59c596d2faf458f0bfb2effac7ccf34448525a779254a0b
MD5 dde4d70e501b1413783171b7fbd13b31
BLAKE2b-256 6a46f17a44f7ebc9f450e4523022d4c93de928b15ef19c792a43e82bb1ee8eea

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page