Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
OPENCODE_MCP_HOMENoLocation of the config file
OPENCODE_MCP_LOCKNoLocked fields, comma-separated, or 'all'. Options: model, agent, permissionMode.
OPENCODE_MCP_PORTNoPort for the spawned server
OPENCODE_MCP_AGENTNoOpenCode agent
OPENCODE_MCP_MODELNoDefault model as provider/model
OPENCODE_MCP_DIRECTORYNoDefault working directory
OPENCODE_MCP_SERVER_URLNoUse an existing OpenCode server instead of spawning one
OPENCODE_MCP_PERMISSION_MODENoPermission mode: auto / readonly / strict

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
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

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/teodorgross/opencode-mcp-bridge'

If you have feedback or need assistance with the MCP directory API, please join our Discord server