SYS.OPENCODE_BRIDGEMCP // FIVE-TOOLS

// worker control room

Your main model plans. OpenCode ships.

A small MCP bridge. Your host model (Codex or Claude Code) calls its endpoint, and the bridge runs worker sessions against an OpenCode server you control. Five tools, then verify and clean up.

Endpoint
/worker-mcp
Tool surface
5 tools, nothing else
OpenCode server
you run it, 127.0.0.1:4096

01 // What this is

A bridge. Nothing more.

What it is

An MCP server. Codex or Claude Code connects to its endpoint and gets five worker tools: catalog, run, status, verify, cleanup.

What it is not

Not OpenCode itself. Not a model provider. Not a hosted coding environment. The endpoint below is the owner's demo, not an unlimited shared service.

What you run

An OpenCode server you control. The bridge defaults to http://127.0.0.1:4096 and talks to it over HTTP.

02 // Your OpenCode server

Point the bridge at a server you control.

Start OpenCode with opencode serve. Default host is 127.0.0.1, default port is 4096. Pick the setup that matches where the server lives.

> A. Same machine

Bridge and OpenCode on the same box. Safest default.

$ opencode - local server
opencode serve --hostname 127.0.0.1 --port 4096

> B. Private remote host

Server on a box you reach over the network. Set a password, put it behind HTTPS and a firewall, then point the bridge at it with OPENCODE_BASE_URL. Never expose it unauthenticated.

$ opencode - private remote
OPENCODE_SERVER_PASSWORD=... opencode serve --hostname 0.0.0.0 --port 4096

> C. Existing deployment

Already run OpenCode somewhere? Point the bridge at it with OPENCODE_BASE_URL. Placeholder address, replace it:

$ bridge - existing server
OPENCODE_BASE_URL=https://opencode.example.com

03 // Coordination loop

Four stations. One direction. No loops left open.

  1. 01

    HOST

    Codex or Claude Code plans the work.

  2. 02

    DISPATCH

    Bridge spawns an isolated OpenCode session.

  3. 03

    WORKER

    Worker executes in its own worktree.

  4. 04

    VERIFY

    Host checks the diff, then cleans up.

$ session transcript

catalog -> run -> status -> verify -> cleanup # every session ends closed

04 // Five-tool surface

Small enough to hold in your head.

The host keeps the plan. The worker keeps the worktree. Only five verbs cross the boundary, so context stays lean and every session is auditable.

  • TOOL_01

    catalog

    List what workers can do before you spend a token.

  • TOOL_02

    run

    Dispatch one isolated session with a tight brief.

  • TOOL_03

    status

    Poll the session. No babysitting, no open loop.

  • TOOL_04

    verify

    Check the diff against the brief. Explicit, not vibes.

  • TOOL_05

    cleanup

    Tear down the worktree. Leave no residue.

  • That is the whole API.
    Learn it once, script it forever.

05 // Install

Paste two lines. Dispatch workers.

These snippets use the site owner's example endpoint: https://opencode-mcp.manuotel.com/worker-mcp. It is a demo, not an unlimited shared service. Self-hosting? Replace it with your own bridge URL.

Set your own token first: export OPENCODE_MCP_BEARER_TOKEN=... Full client setup lives in the README.

> Codex MCP

$ codex - mcp bridge
codex mcp add opencode --url https://opencode-mcp.manuotel.com/worker-mcp --bearer-token-env-var OPENCODE_MCP_BEARER_TOKEN

> Claude Code plugin Recommended

Easiest path for Claude Code users. Register the marketplace, then install the worker plugin. Two commands, in order:

$ claude - 1/2 marketplace
claude plugin marketplace add ManuOtel/opencode-mcp-bridge
$ claude - 2/2 worker plugin
claude plugin install opencode-worker@opencode-mcp-bridge

> Claude Code native MCP - fallback

Prefer the plugin above. Use this native MCP command only if you cannot install plugins:

$ claude - mcp bridge (fallback)
claude mcp add --transport http opencode-worker https://opencode-mcp.manuotel.com/worker-mcp --header "Authorization: Bearer $OPENCODE_MCP_BEARER_TOKEN"

> Codex plugin marketplace

Prefer the plugin route. Register the marketplace, then add the worker plugin. Two commands, in order:

$ codex - 1/2 marketplace
codex plugin marketplace add ManuOtel/opencode-mcp-bridge --ref master
$ codex - 2/2 worker plugin
codex plugin add opencode-worker --marketplace opencode-mcp-bridge

06 // Security / operations

Isolated by default. Verified on purpose.

  • Bearer auth on /worker-mcp

    Every call carries your own bearer token. No token, no dispatch. You configure and rotate it.

  • Isolated worktrees

    Each worker session runs in its own worktree. Your main checkout stays untouched until you accept the diff.

  • Explicit verify

    Nothing merges on good intentions. The host verifies output against the brief before anything lands.

  • No open servers

    A remote OpenCode server stays behind HTTPS, auth, and a firewall. Localhost stays on 127.0.0.1 unless you know why it should not.

Setup details are in the client setup docs.

// open source

Stop babysitting diffs. Start dispatching.

Read the code, open an issue, or wire up your first worker tonight.