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.5.tar.gz (176.2 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.5-py3-none-any.whl (56.6 kB view details)

Uploaded Python 3

File details

Details for the file opencode_a2a_server-0.2.5.tar.gz.

File metadata

  • Download URL: opencode_a2a_server-0.2.5.tar.gz
  • Upload date:
  • Size: 176.2 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.5.tar.gz
Algorithm Hash digest
SHA256 4efc1b8b4006725316c8adf552ac8dc640bc01a7514f3c2f9a2a6463e5359d2c
MD5 bf95bea4b7bfafe247972f5ce0f67c24
BLAKE2b-256 d7dbec5d32f38900b267e5e67d9e064bbf16c7e2d17c4e445ec906dff1859704

See more details on using hashes here.

Provenance

The following attestation bundles were made for opencode_a2a_server-0.2.5.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.5-py3-none-any.whl.

File metadata

File hashes

Hashes for opencode_a2a_server-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 44dc6d1d3e7ba1da092dd93e606876811a7ec575647fa0afbfc6dd1ccf40c91c
MD5 e0c516e16b207e3d26b691852e7577ec
BLAKE2b-256 9dc00d6df85c29a6e455e1f1a380ddb9a634a1124144a66c214b3da5a121c6d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for opencode_a2a_server-0.2.5-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