opencode-mcp-bridge
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| OPENCODE_MCP_HOME | No | Location of the config file | |
| OPENCODE_MCP_LOCK | No | Locked fields, comma-separated, or 'all'. Options: model, agent, permissionMode. | |
| OPENCODE_MCP_PORT | No | Port for the spawned server | |
| OPENCODE_MCP_AGENT | No | OpenCode agent | |
| OPENCODE_MCP_MODEL | No | Default model as provider/model | |
| OPENCODE_MCP_DIRECTORY | No | Default working directory | |
| OPENCODE_MCP_SERVER_URL | No | Use an existing OpenCode server instead of spawning one | |
| OPENCODE_MCP_PERMISSION_MODE | No | Permission mode: auto / readonly / strict |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| opencode_healthA | Starts a local opencode server if needed (or attaches to a running one) and reports its version and the current settings. |
| opencode_agentsA | Lists the agents configured in opencode with their mode and description, for use as the 'agent' parameter of a dispatch. |
| opencode_modelsA | Lists the providers and models configured in opencode as 'provider/model' IDs. Use 'filter' to narrow the list. Never returns API keys. |
| opencode_set_modelA | Persists which model, agent and permission mode future opencode tasks use. Every field is optional; only the fields you pass are changed. |
| opencode_dispatchA | Creates a temporary opencode session and hands it the task. Returns IMMEDIATELY with a runId, without waiting for the result. Afterwards call 'opencode_wait' with the runId until the run is finished. The task must be described completely and self-contained, because the session knows nothing about this conversation. |
| opencode_follow_upA | Sends a follow-up instruction into the session of an earlier run, so the subagent keeps everything it already worked out. Requires that the earlier run was dispatched with keepSession: true. Returns a new runId to wait on. |
| opencode_waitA | Waits up to 'maxSeconds' for a run to finish. If it is done, the full result comes back. If it is still running, a progress report comes back — then simply call again. Never blocks indefinitely, and never shortens the run itself: the task keeps going between calls no matter how long it takes. Returns the moment opencode reports the session idle — there is no polling delay. While waiting it emits notifications/progress with the live tool activity, so a client that sets resetTimeoutOnProgress can raise maxSeconds well past its own default timeout. Pass 'runIds' instead of 'runId' to wait for whichever of several parallel runs finishes first. |
| opencode_answerA | Answers the question a run is parked on. Only reachable when autoAnswerQuestions is disabled in the configuration; otherwise questions are rejected automatically so a headless run can never hang. 'answers' holds one array of chosen labels per question, in order. |
| opencode_messagesA | Returns the complete conversation of a run's session — every message with its tool calls. Use this to audit what the subagent actually did when the summary is not enough. |
| opencode_diffA | Returns the actual patch per file for a run, not just the file names. Relies on opencode's workspace snapshots, so it is empty outside a git repository — opencode_result still lists the touched files in that case. |
| opencode_todosA | Returns the subagent's own todo list for a run — the most informative view of a long task while it is still working. |
| opencode_statusA | Returns the current state of a run immediately, without waiting. |
| opencode_resultA | Returns the final result of a finished run (reply text, changed files, cost). |
| opencode_cancelA | Aborts a running opencode run and cleans up the temporary session. |
| opencode_runsA | Lists every run of this MCP session with its status and duration. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 15 tools
Each tool targets a distinct aspect of the opencode lifecycle: server health, configuration, run creation, monitoring, cancellation, and result retrieval. While several tools return run information (status, result, messages, diff, todos), their descriptions clearly differentiate the exact data each returns.
All tools share the consistent 'opencode_' prefix and snake_case format. The naming mixes nouns for query tools (opencode_result, opencode_todos) and verbs for action tools (opencode_dispatch, opencode_wait), which is a reasonable convention, though not a uniform verb_noun pattern.
With 15 tools, the server sits at the upper edge of a well-scoped set. Each tool serves a clear purpose in managing opencode runs, covering dispatch, waiting, follow-up, cancellation, and detailed inspection, without unnecessary redundancy.
The tool set provides comprehensive coverage of the opencode run lifecycle: creating runs, following up, waiting, answering questions, cancelling, and retrieving results, messages, diffs, todos, and status. Configuration tools for models, agents, and health are also included, leaving no obvious gaps.