opencode-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| OPENCODE_BASE_URL | No | OpenCode server URL | http://127.0.0.1:4096 |
| OPENCODE_AUTO_SERVE | No | Auto-start an in-process OpenCode server if none is reachable | true |
| OPENCODE_DEFAULT_MODEL | No | Default model ID when not specified per-tool | |
| OPENCODE_SERVER_PASSWORD | No | HTTP basic auth password (enables auth when set) | |
| OPENCODE_SERVER_USERNAME | No | HTTP basic auth username | opencode |
| OPENCODE_DEFAULT_PROVIDER | No | Default provider ID when not specified per-tool |
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
} |
| prompts | {
"listChanged": true
} |
| resources | {
"listChanged": true
} |
| extensions | {
"io.modelcontextprotocol/tasks": {}
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| opencode_healthA | Check server health and version |
| opencode_config_getB | Get the current opencode configuration |
| opencode_config_updateC | Update the opencode configuration. Pass a partial config object with fields to update. |
| opencode_config_providersB | List all configured providers and their default models |
| opencode_project_listA | List all projects known to the opencode server |
| opencode_project_initA | Initialize or open a project directory to host an independent OpenCode session. Use this to create new empty folders, or to explicitly open preexisting projects on the MCP host machine for parallel code generation workloads. This tool operates on the local filesystem; create remote server directories separately. |
| opencode_project_currentC | Get the current active project |
| opencode_session_listB | List all sessions |
| opencode_session_createB | Create a new session. Optionally provide a parentID to create a child session, and a title. |
| opencode_session_getB | Get details of a specific session by ID |
| opencode_session_deleteA | Delete a session and all its data |
| opencode_session_updateB | Update session properties (e.g. title) |
| opencode_session_childrenA | Get child sessions of a session |
| opencode_session_statusA | Get status for all sessions (running, idle, etc.) |
| opencode_session_todoA | Get the todo list for a session |
| opencode_session_initA | Analyze the app and create AGENTS.md for a session. NOTE: This is a long-running operation that may take 30-60+ seconds depending on project size. |
| opencode_session_abortB | Abort a running session |
| opencode_session_forkB | Fork an existing session, optionally at a specific message |
| opencode_session_shareC | Share a session publicly |
| opencode_session_unshareB | Unshare a previously shared session |
| opencode_session_diffB | Get the diff for a session, optionally for a specific message |
| opencode_session_summarizeA | Summarize a session using a specified model. NOTE: This is a long-running operation that may take 30-60+ seconds. |
| opencode_session_revertC | Revert a message in a session |
| opencode_session_unrevertA | Restore all reverted messages in a session |
| opencode_permission_listA | List all pending permission requests across all sessions. When a session is blocked waiting for approval (e.g. to run a shell command or access a file outside the project), it appears here. Respond with |
| opencode_session_permissionA | Respond to a permission request in a session. Use |
| opencode_session_searchA | Search sessions by keyword in title. Useful for finding a specific session among many. |
| opencode_message_listA | List all messages in a session with formatted output showing roles and content |
| opencode_message_getA | Get details of a specific message in a session |
| opencode_message_sendB | Send a prompt message to a session and wait for the AI response. Use parts to send text, and optionally specify a model. |
| opencode_message_send_asyncA | Send a prompt asynchronously and return its messageId. Pass sessionId and messageId to opencode_wait to observe this exact turn. |
| opencode_command_executeB | Execute a slash command in a session (e.g. /init, /undo, /redo) |
| opencode_shell_executeC | Run a shell command through the opencode session |
| opencode_find_textA | Search for text patterns in project files (regex supported). Returns file paths, line numbers, and matching lines. |
| opencode_find_fileA | Find files and directories by name (fuzzy match) |
| opencode_find_symbolA | Find workspace symbols by name (functions, classes, variables, etc.) |
| opencode_file_listB | List files and directories at a path |
| opencode_file_readB | Read the content of a file |
| opencode_file_statusA | Get status for tracked files (VCS changes: modified, added, deleted, etc.) |
| opencode_provider_listA | List all configured providers with their connection status. Returns a compact summary — use opencode_provider_models to see models for a specific provider. |
| opencode_provider_modelsA | List available models for a specific provider. Call opencode_provider_list first to see provider IDs. |
| opencode_provider_auth_methodsB | Get available authentication methods for all providers |
| opencode_provider_oauth_authorizeC | Start OAuth authorization for a provider |
| opencode_provider_oauth_callbackC | Handle OAuth callback for a provider |
| opencode_auth_setB | Set authentication credentials for a provider (e.g. API key). Credentials are stored globally and shared across all projects. |
| opencode_path_getB | Get the current working path of the opencode server |
| opencode_vcs_infoA | Get VCS (version control) info for the current project (branch, remote, status) |
| opencode_instance_disposeA | Dispose the current opencode instance (shuts it down). WARNING: This is destructive and will terminate the server. |
| opencode_agent_listA | List all available agents with their names, descriptions, and modes (primary/subagent) |
| opencode_command_listA | List all available commands (built-in and custom slash commands) |
| opencode_lsp_statusB | Get the status of LSP (Language Server Protocol) servers |
| opencode_formatter_statusC | Get the status of configured formatters |
| opencode_mcp_statusA | Get the status of all MCP servers configured in opencode |
| opencode_mcp_addC | Add an MCP server dynamically to opencode |
| opencode_tool_idsA | List all available tool IDs that the LLM can use (experimental) |
| opencode_tool_listA | List tools with JSON schemas for a given provider and model (experimental) |
| opencode_logB | Write a log entry to the opencode server |
| opencode_setupB | Check OpenCode status, provider configuration, and optionally initialize a project directory. Use this as the first step when starting work — it tells you what is ready and what still needs configuration. |
| opencode_askB | Ask OpenCode a question in one step. Creates a new session, sends your prompt, and returns the AI response. This is the easiest way to interact with OpenCode. |
| opencode_replyA | Send a follow-up message to an existing session. Use this to continue a conversation started with opencode_ask or opencode_session_create. |
| opencode_conversationB | Get the full conversation history of a session, formatted for easy reading. Shows all messages with their roles and content. |
| opencode_sessions_overviewA | Get a quick overview of all sessions with their titles and status. Useful to find which session to continue working in. |
| opencode_contextA | Get full project context in one call: current project, path, VCS info, config, and available agents. Useful to understand the current state before starting work. |
| opencode_waitA | Wait for a session or durable job. Returns completed, failed, input_required, or a resumable timeout. Cancelling this wait stops observation; use job_cancel or session_abort to stop OpenCode. |
| opencode_review_changesA | Get a formatted summary of all file changes made in a session. Shows diffs in a readable format. |
| opencode_provider_testA | Quick-test whether a provider is working. Creates a temporary session, sends a trivial prompt, checks the response, and cleans up. Great for debugging auth issues. |
| opencode_runA | Send a task and wait for its correlated response. Returns a durable job ID; an observation timeout leaves the remote job running and can be resumed with opencode_wait. |
| opencode_fireA | Dispatch a durable background task and return its job, session and message IDs immediately. Use opencode_check or opencode_wait to observe; job_cancel stops the task. |
| opencode_checkA | Get current task status, pending input, todos and file counts. Uses session summary metadata instead of fetching patches. Pass jobId for exact durable turn correlation; detailed includes response text. |
| opencode_statusA | Get a quick status dashboard: server health, provider count, session count, and VCS info. Lighter than opencode_setup — good for at-a-glance checks. |
| opencode_tui_append_promptB | Append text to the TUI's prompt input field |
| opencode_tui_submit_promptA | Submit the current prompt in the TUI (equivalent to pressing Enter) |
| opencode_tui_clear_promptB | Clear the current prompt text in the TUI |
| opencode_tui_execute_commandA | Execute a slash command through the TUI (e.g. '/init', '/undo') |
| opencode_tui_show_toastC | Show a toast notification in the TUI |
| opencode_tui_open_helpA | Open the help dialog in the TUI |
| opencode_tui_open_sessionsB | Open the session selector in the TUI |
| opencode_tui_open_modelsB | Open the model selector in the TUI |
| opencode_tui_open_themesB | Open the theme selector in the TUI |
| opencode_events_pollA | Poll project events from OpenCode, or explicitly select global scope. Collects up to maxEvents within the duration. Connection failures are reported with any partial events; stopping observation does not abort remote work. |
| opencode_question_listA | List pending OpenCode questions, optionally filtered to a session. |
| opencode_question_replyB | Answer an OpenCode question request. Supply one array of selected labels or free text per question. |
| opencode_question_rejectB | Reject a pending OpenCode question explicitly. |
| opencode_job_getA | Observe a durable job by ID, including pending inputs and final results. |
| opencode_job_cancelA | Explicitly abort the OpenCode session owned by a job. This also stops other work in that session. |
| opencode_job_listA | List locally retained jobs in this OpenCode server and credential scope. |
| opencode_job_inputB | Respond to a job's pending questions or permissions. Omit responses to request MCP forms when supported, or receive manual response instructions. Never approves automatically. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| opencode-code-review | Review code changes in an OpenCode session. Fetches the diff and provides a structured review. |
| opencode-debug | Start a debugging session with OpenCode |
| opencode-project-setup | Get oriented in a new project using OpenCode |
| opencode-implement | Have OpenCode implement a feature or make changes |
| opencode-best-practices | Get best practices for using OpenCode MCP tools effectively. Covers tool selection, async workflows, provider configuration, and common pitfalls. |
| opencode-session-summary | Summarize what happened in an OpenCode session |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| project-current | The currently active OpenCode project |
| config | Current OpenCode configuration |
| providers | All available LLM providers, their models, and connection status |
| agents | All available agents and their configurations |
| commands | All available commands (built-in and custom) |
| health | OpenCode server health and version |
| vcs | Version control system info for the current project |
| sessions | All sessions |
| mcp-servers | Status of all configured MCP servers in OpenCode |
| file-status | VCS status of all tracked files |
TDQS
Scored across 87 tools
Many tools overlap heavily: opencode_session_list/opencode_sessions_overview/opencode_session_status, opencode_message_send/opencode_ask/opencode_reply/opencode_run, opencode_wait/opencode_check/opencode_job_get, and opencode_tui_* commands are numerous. An agent would struggle to pick the right tool among these near-duplicates.
The opencode_ prefix and mostly verb_noun pattern (e.g. opencode_session_create, opencode_file_read) is consistent. Minor deviations exist like opencode_ask, opencode_reply, opencode_fire, opencode_run, and opencode_log which break the verb_noun convention, but the overall pattern is predictable.
87 tools is far beyond the typical well-scoped MCP server. The count is extreme and includes many overlapping or highly granular tools (e.g. 10 TUI tools, 6 provider tools, 5 job tools) that could be consolidated.
The surface is very comprehensive for the opencode domain: sessions, messages, files, providers, permissions, jobs, TUI, and VCS are all covered. There are no obvious dead ends, though the sheer number of tools makes it hard to verify every workflow.