opencode-mcp
v3.1.0MCP server for OpenCode coding workflows, durable async jobs, project resources, and explicit user input
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
opencode_health
Check server health and version
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_config_get
Get the current opencode configuration
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_config_update
Update the opencode configuration. Pass a partial config object with fields to update.
| Parameter | Type | Description |
|---|---|---|
config * | object | Partial config object with fields to update |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_config_providers
List all configured providers and their default models
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_project_list
List all projects known to the opencode server
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_project_init
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.
| Parameter | Type | Description |
|---|---|---|
path * | string | The absolute file path where the project directory is located or should be created. |
opencode_project_current
Get the current active project
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_session_list
List all sessions
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_session_create
Create a new session. Optionally provide a parentID to create a child session, and a title.
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
parentID | string | Parent session ID |
title | string | Session title |
opencode_session_get
Get details of a specific session by ID
| Parameter | Type | Description |
|---|---|---|
id * | string | Session ID |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_session_delete
Delete a session and all its data
| Parameter | Type | Description |
|---|---|---|
id * | string | Session ID to delete |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_session_update
Update session properties (e.g. title)
| Parameter | Type | Description |
|---|---|---|
id * | string | Session ID |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
title | string | New title for the session |
opencode_session_children
Get child sessions of a session
| Parameter | Type | Description |
|---|---|---|
id * | string | Parent session ID |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_session_status
Get status for all sessions (running, idle, etc.)
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_session_todo
Get the todo list for a session
| Parameter | Type | Description |
|---|---|---|
id * | string | Session ID |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_session_init
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.
| Parameter | Type | Description |
|---|---|---|
id * | string | Session ID |
messageID * | string | Message ID |
modelID * | string | Model ID (e.g. 'claude-3-5-sonnet-20241022') |
providerID * | string | Provider ID (e.g. 'anthropic') |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
variant | string | Model variant (e.g. 'fast', 'smart') |
opencode_session_abort
Abort a running session
| Parameter | Type | Description |
|---|---|---|
id * | string | Session ID to abort |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_session_fork
Fork an existing session, optionally at a specific message
| Parameter | Type | Description |
|---|---|---|
id * | string | Session ID to fork |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
messageID | string | Message ID to fork at (optional) |
opencode_session_diff
Get the diff for a session, optionally for a specific message
| Parameter | Type | Description |
|---|---|---|
id * | string | Session ID |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
messageID | string | Message ID (optional) |
opencode_session_summarize
Summarize a session using a specified model. NOTE: This is a long-running operation that may take 30-60+ seconds.
| Parameter | Type | Description |
|---|---|---|
id * | string | Session ID |
modelID * | string | Model ID (e.g. 'claude-3-5-sonnet-20241022') |
providerID * | string | Provider ID (e.g. 'anthropic') |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
variant | string | Model variant (e.g. 'fast', 'smart') |
opencode_session_revert
Revert a message in a session
| Parameter | Type | Description |
|---|---|---|
id * | string | Session ID |
messageID * | string | Message ID to revert |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
partID | string | Part ID to revert (optional) |
opencode_session_unrevert
Restore all reverted messages in a session
| Parameter | Type | Description |
|---|---|---|
id * | string | Session ID |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_permission_list
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_permission`.
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_session_permission
Respond to a permission request in a session. Use `opencode_permission_list` to see pending requests. Reply values: 'once' (approve this request only), 'always' (approve this + future matching requests for this session), 'reject' (deny the request).
| Parameter | Type | Description |
|---|---|---|
id * | string | Session ID |
permissionID * | string | Permission request ID |
reply * | string | Response to the permission request: 'once' to approve once, 'always' to auto-approve matching future requests, 'reject' to deny |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_session_search
Search sessions by keyword in title. Useful for finding a specific session among many.
| Parameter | Type | Description |
|---|---|---|
query * | string | Search keyword (case-insensitive match on session title) |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_message_list
List all messages in a session with formatted output showing roles and content
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | Session ID |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
limit | number | Maximum number of messages to return |
opencode_message_get
Get details of a specific message in a session
| Parameter | Type | Description |
|---|---|---|
messageId * | string | Message ID |
sessionId * | string | Session ID |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_message_send
Send a prompt message to a session and wait for the AI response. Use parts to send text, and optionally specify a model.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | Session ID |
text * | string | The text message to send |
agent | string | Agent to use |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
format | Response format: plain text or JSON constrained by a JSON Schema. JSON Schema requires OpenCode permission for the StructuredOutput tool. | |
modelID | string | Model ID (e.g. 'claude-3-5-sonnet-20241022') |
noReply | boolean | If true, inject context without triggering AI response (useful for plugins) |
providerID | string | Provider ID (e.g. 'anthropic') |
system | string | System prompt override |
variant | string | Model variant (e.g. 'fast', 'smart') |
opencode_message_send_async
Send a prompt asynchronously and return its messageId. Pass sessionId and messageId to opencode_wait to observe this exact turn.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | Session ID |
text * | string | The text message to send |
agent | string | Agent to use |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
format | Response format: plain text or JSON constrained by a JSON Schema. JSON Schema requires OpenCode permission for the StructuredOutput tool. | |
modelID | string | Model ID (e.g. 'claude-3-5-sonnet-20241022') |
providerID | string | Provider ID (e.g. 'anthropic') |
variant | string | Model variant (e.g. 'fast', 'smart') |
opencode_command_execute
Execute a slash command in a session (e.g. /init, /undo, /redo)
| Parameter | Type | Description |
|---|---|---|
command * | string | The slash command to execute (e.g. 'init', 'undo') |
sessionId * | string | Session ID |
agent | string | Agent to use |
arguments | string | Arguments for the command |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
modelID | string | Model ID |
providerID | string | Provider ID |
variant | string | Model variant |
opencode_shell_execute
Run a shell command through the opencode session
| Parameter | Type | Description |
|---|---|---|
agent * | string | Agent to use for the shell command |
command * | string | Shell command to execute |
sessionId * | string | Session ID |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
modelID | string | Model ID |
providerID | string | Provider ID |
opencode_find_text
Search for text patterns in project files (regex supported). Returns file paths, line numbers, and matching lines.
| Parameter | Type | Description |
|---|---|---|
pattern * | string | Text or regex pattern to search for in files |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_find_file
Find files and directories by name (fuzzy match)
| Parameter | Type | Description |
|---|---|---|
query * | string | Search string for file/directory names |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
limit | number | Max number of results (1-200) |
searchDirectory | string | Override the project root for the search |
type | string | Limit results to 'file' or 'directory' |
opencode_find_symbol
Find workspace symbols by name (functions, classes, variables, etc.)
| Parameter | Type | Description |
|---|---|---|
query * | string | Symbol name to search for |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_file_list
List files and directories at a path
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
path | string | Path to list (defaults to project root) |
opencode_file_read
Read the content of a file
| Parameter | Type | Description |
|---|---|---|
path * | string | File path to read |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_file_status
Get status for tracked files (VCS changes: modified, added, deleted, etc.)
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_provider_list
List all configured providers with their connection status. Returns a compact summary — use opencode_provider_models to see models for a specific provider.
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_provider_models
List available models for a specific provider. Call opencode_provider_list first to see provider IDs.
| Parameter | Type | Description |
|---|---|---|
providerId * | string | Provider ID (e.g. 'anthropic', 'openrouter', 'google') |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
limit | number | Max models to show (default 30). Use 0 for all. |
opencode_provider_auth_methods
Get available authentication methods for all providers
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_provider_oauth_authorize
Start OAuth authorization for a provider
| Parameter | Type | Description |
|---|---|---|
providerId * | string | Provider ID to authorize |
inputs | object | Additional inputs requested by the selected authentication method |
method | integer | Auth method index from opencode_provider_auth_methods (default 0) |
opencode_provider_oauth_callback
Handle OAuth callback for a provider
| Parameter | Type | Description |
|---|---|---|
callbackData * | object | OAuth callback data |
providerId * | string | Provider ID |
opencode_auth_set
Set authentication credentials for a provider (e.g. API key). Credentials are stored globally and shared across all projects.
| Parameter | Type | Description |
|---|---|---|
key * | string | API key or credential value |
providerId * | string | Provider ID (e.g. 'anthropic') |
type * | string | Auth type (e.g. 'api') |
opencode_path_get
Get the current working path of the opencode server
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_vcs_info
Get VCS (version control) info for the current project (branch, remote, status)
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_instance_dispose
Dispose the current opencode instance (shuts it down). WARNING: This is destructive and will terminate the server.
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_agent_list
List all available agents with their names, descriptions, and modes (primary/subagent)
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_command_list
List all available commands (built-in and custom slash commands)
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_lsp_status
Get the status of LSP (Language Server Protocol) servers
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_formatter_status
Get the status of configured formatters
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_mcp_status
Get the status of all MCP servers configured in opencode
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_mcp_add
Add an MCP server dynamically to opencode
| Parameter | Type | Description |
|---|---|---|
config * | object | MCP server configuration object |
name * | string | Name for the MCP server |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_tool_ids
List all available tool IDs that the LLM can use (experimental)
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_tool_list
List tools with JSON schemas for a given provider and model (experimental)
| Parameter | Type | Description |
|---|---|---|
model * | string | Model ID |
provider * | string | Provider ID |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_log
Write a log entry to the opencode server
| Parameter | Type | Description |
|---|---|---|
level * | string | Log level |
message * | string | Log message |
service * | string | Service name for the log entry |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
extra | object | Extra data to include in the log entry |
opencode_setup
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.
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_ask
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.
| Parameter | Type | Description |
|---|---|---|
prompt * | string | The question or instruction to send |
agent | string | Agent to use (e.g. 'build', 'plan') |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
format | Response format: plain text or JSON constrained by a JSON Schema. JSON Schema requires OpenCode permission for the StructuredOutput tool. | |
modelID | string | Model ID (e.g. 'claude-3-5-sonnet-20241022') |
providerID | string | Provider ID (e.g. 'anthropic') |
system | string | Optional system prompt override |
title | string | Optional title for the session |
variant | string | Model variant (e.g. 'fast', 'smart') |
opencode_reply
Send a follow-up message to an existing session. Use this to continue a conversation started with opencode_ask or opencode_session_create.
| Parameter | Type | Description |
|---|---|---|
prompt * | string | The follow-up message |
sessionId * | string | Session ID to reply in |
agent | string | Agent to use |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
format | Response format: plain text or JSON constrained by a JSON Schema. JSON Schema requires OpenCode permission for the StructuredOutput tool. | |
modelID | string | Model ID |
providerID | string | Provider ID |
variant | string | Model variant |
opencode_conversation
Get the full conversation history of a session, formatted for easy reading. Shows all messages with their roles and content.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | Session ID |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
limit | number | Max messages to return (default: all) |
opencode_sessions_overview
Get a quick overview of all sessions with their titles and status. Useful to find which session to continue working in.
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_context
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.
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_wait
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.
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
jobId | string | Durable job ID returned by opencode_fire or opencode_run |
messageId | string | Submitted user message ID to correlate the exact response |
pollIntervalMs | integer | Polling interval in milliseconds (default 2000) |
sessionId | string | Session ID (required unless jobId is supplied) |
timeoutSeconds | number | Maximum seconds to wait (default 120); timeout is resumable |
opencode_review_changes
Get a formatted summary of all file changes made in a session. Shows diffs in a readable format.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | Session ID |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
messageID | string | Specific message ID to get diff for |
opencode_provider_test
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.
| Parameter | Type | Description |
|---|---|---|
providerId * | string | Provider ID to test (e.g. 'anthropic', 'openrouter') |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
format | Response format: plain text or JSON constrained by a JSON Schema. JSON Schema requires OpenCode permission for the StructuredOutput tool. | |
modelID | string | Specific model ID to test. If omitted, discovers the provider default or first available model. |
variant | string | Model variant |
opencode_run
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.
| Parameter | Type | Description |
|---|---|---|
prompt * | string | Task or instruction to send to OpenCode |
agent | string | OpenCode agent name |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
format | Response format: plain text or JSON constrained by a JSON Schema. JSON Schema requires OpenCode permission for the StructuredOutput tool. | |
maxDurationSeconds | number | Maximum observation duration in seconds (default 600); timeout does not abort the job |
modelID | string | Model ID from provider discovery |
providerID | string | Provider ID from provider discovery |
sessionId | string | Existing session to continue; omit to create one |
title | string | Title for a new session |
variant | string | Model variant |
opencode_fire
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.
| Parameter | Type | Description |
|---|---|---|
prompt * | string | Task or instruction to send to OpenCode |
agent | string | OpenCode agent name |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
format | Response format: plain text or JSON constrained by a JSON Schema. JSON Schema requires OpenCode permission for the StructuredOutput tool. | |
modelID | string | Model ID from provider discovery |
providerID | string | Provider ID from provider discovery |
sessionId | string | Existing session to continue; omit to create one |
title | string | Title for a new session |
variant | string | Model variant |
opencode_check
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.
| Parameter | Type | Description |
|---|---|---|
detailed | boolean | Include response text (default false) |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
jobId | string | Durable job ID |
messageId | string | Submitted user message ID to correlate |
sessionId | string | Session ID (required unless jobId is supplied) |
opencode_status
Get a quick status dashboard: server health, provider count, session count, and VCS info. Lighter than opencode_setup — good for at-a-glance checks.
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_tui_append_prompt
Append text to the TUI's prompt input field
| Parameter | Type | Description |
|---|---|---|
text * | string | Text to append to the prompt |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_tui_submit_prompt
Submit the current prompt in the TUI (equivalent to pressing Enter)
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_tui_clear_prompt
Clear the current prompt text in the TUI
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_tui_execute_command
Execute a slash command through the TUI (e.g. '/init', '/undo')
| Parameter | Type | Description |
|---|---|---|
command * | string | Command to execute (e.g. '/init') |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_tui_show_toast
Show a toast notification in the TUI
| Parameter | Type | Description |
|---|---|---|
message * | string | Toast message text |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
title | string | Optional toast title |
variant | string | Toast variant (default: info) |
opencode_tui_open_help
Open the help dialog in the TUI
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_tui_open_sessions
Open the session selector in the TUI
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_tui_open_models
Open the model selector in the TUI
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_tui_open_themes
Open the theme selector in the TUI
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_events_poll
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.
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
durationMs | integer | How long to collect events in milliseconds (default: 3000, max: 30000) |
maxEvents | integer | Maximum number of events to collect (default: 50, max: 1000) |
scope | string | Event scope (default: project). Global events include all projects and cannot be combined with directory. |
opencode_question_list
List pending OpenCode questions, optionally filtered to a session.
| Parameter | Type | Description |
|---|---|---|
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
sessionId | string |
opencode_question_reply
Answer an OpenCode question request. Supply one array of selected labels or free text per question.
| Parameter | Type | Description |
|---|---|---|
answers * | array | |
requestId * | string | |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_question_reject
Reject a pending OpenCode question explicitly.
| Parameter | Type | Description |
|---|---|---|
requestId * | string | |
directory | string | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. |
opencode_job_get
Observe a durable job by ID, including pending inputs and final results.
| Parameter | Type | Description |
|---|---|---|
jobId * | string |
opencode_job_cancel
Explicitly abort the OpenCode session owned by a job. This also stops other work in that session.
| Parameter | Type | Description |
|---|---|---|
jobId * | string |
opencode_job_list
List locally retained jobs in this OpenCode server and credential scope.
| Parameter | Type | Description |
|---|---|---|
limit | integer |
opencode_job_input
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.
| Parameter | Type | Description |
|---|---|---|
jobId * | string | |
responses | array |