opencode-cli-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
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
} |
| logging | {} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| extensions | {
"io.modelcontextprotocol/ui": {}
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| opencode_mcpb_installA | OPENCODE_MCPB_INSTALL - Install an MCPB bundle into opencode config. Unpacks the .mcpb (or reads an unpacked directory), extracts the manifest,
and merges the server definition into the opencode config file's Return Format{"success": bool, "server_name": str, "config_path": str, "entry": {...}} Examplesopencode_mcpb_install(source="./dist/arxiv-mcp-v1.0.0.mcpb") opencode_mcpb_install(source="./dist/arxiv-mcp-v1.0.0.mcpb", name_override="arxiv") opencode_mcpb_install(source="./mcpb/", dry_run=True) |
| opencode_shutdownA | Shut down this MCP server process gracefully. Return Format{"success": bool, "message": str, "data": dict} Examplesopencode_shutdown(confirm=True, reason="maintenance window") opencode_shutdown(confirm=False) |
| opencode_runsA | Manage opencode agent runs: start, poll status, list recent, or cancel. Return Format{"success": bool, "message": str, "data": dict} Fire-and-forget starts return a job_id; poll with action="status". Examplesopencode_runs(action="start", prompt="Refactor main.py", wait=False) opencode_runs(action="status", job_id="abc123") opencode_runs(action="list", limit=20, offset=0) |
| opencode_sessionsC | Inspect and interact with opencode sessions: list, get, transcript, send, diff, grep, export, rename, or delete. Return Format{"success": bool, "message": str, "data": dict} Examplesopencode_sessions(action="list", limit=50) opencode_sessions(action="messages", session_id="sess_01", limit=100) opencode_sessions(action="send", session_id="sess_01", message="continue") opencode_sessions(action="rename", session_id="sess_01", title="Refactor auth module") opencode_sessions(action="delete", session_id="sess_01", confirm=True) |
| opencode_depotA | Session depot: list, inspect, archive/unarchive, rename, delete, search transcripts, semantic RAG search, code-recall search, or stats. Reads opencode's SQLite depot directly - works without Return Format{"success": bool, "message": str, "data": dict} Examplesopencode_depot(action="list", status="archived", limit=20) opencode_depot(action="unarchive", session_id="sess_01") opencode_depot(action="search", query="power limit") opencode_depot(action="rag", query="what did we decide about the power limit") opencode_depot(action="code", path_filter="auth_utils.py") opencode_depot(action="code", query="extracted the auth module", path_filter="src") opencode_depot(action="rag_index") opencode_depot(action="stats") |
| opencode_backupsA | Backup the opencode database and config with rotation + disk guard; restore when needed. Return Format{"success": bool, "message": str, "data": dict} Examplesopencode_backups(action="status") opencode_backups(action="create", kind="all") opencode_backups(action="list", kind="db") opencode_backups(action="restore", name="opencode-db-20260802-120000.sqlite3", confirm=True) |
| opencode_systemA | opencode server environment: health/status, providers, project, launch UI, MCP pulse, or config drift. Return Format{"success": bool, "message": str, "data": dict} Examplesopencode_system(action="status") opencode_system(action="providers") opencode_system(action="launch_ui", mode="web") |
| opencode_run_agentA | Run an opencode agent with a prompt. Launches as background job; returns job_id for polling. Set wait=true to block until done. Return Format{"success": bool, "message": str, "data": {"job_id": str, "status": str}} Examplesopencode_run_agent(prompt="Refactor main.py", wait=False) opencode_run_agent(prompt="Summarize README", format="json", wait=True, timeout=120) |
| opencode_launch_uiA | Launch opencode interactively - TUI, web UI, or background API server. Use this to open the opencode interface for manual work. Return Format{"success": bool, "message": str, "data": {"mode": str, "project": str}} Examplesopencode_launch_ui(mode="web") opencode_launch_ui(mode="serve") |
| opencode_list_sessionsA | List all active and recent opencode sessions. Return Format{"success": bool, "message": str, "data": {"sessions": [{"id": str}]}} Examplesopencode_list_sessions() |
| opencode_get_sessionA | Get detailed information about a specific opencode session. Returns its metadata and state. Return Format{"success": bool, "message": str, "data": {"session": dict}} Examplesopencode_get_session(session_id="sess_01") |
| opencode_send_messageA | Send a message to an existing opencode session. Use this to continue a conversation with a running agent. Return Format{"success": bool, "message": str, "data": {"result": dict}} Examplesopencode_send_message(session_id="sess_01", message="continue") |
| opencode_get_messagesA | Retrieve message history from an opencode session. Returns the conversation transcript between the user and the agent. Return Format{"success": bool, "message": str, "data": {"messages": [{"role": str}]}} Examplesopencode_get_messages(session_id="sess_01", limit=100) |
| opencode_session_diffA | Show files created, modified, and deleted in a session. Returns a diff summary with file paths and change types. Return Format{"success": bool, "message": str, "data": {"diff": dict}} Examplesopencode_session_diff(session_id="sess_01") |
| opencode_server_statusA | Check the status and health of the opencode server. Returns health info, active session count, and config summary. Return Format{"success": bool, "message": str, "data": dict} Examplesopencode_server_status() |
| opencode_list_providersA | List configured LLM providers in opencode. Return Format{"success": bool, "message": str, "data": {"providers": [{"name": str}]}} Examplesopencode_list_providers() |
| opencode_get_projectA | Get the current project context from opencode. Returns the active project path and metadata. Return Format{"success": bool, "message": str, "data": {"project": dict}} Examplesopencode_get_project() |
| opencode_get_configA | Read the full opencode configuration. Returns model, provider, MCP server settings, and instructions. Return Format{"success": bool, "message": str, "data": {"config": dict}} Examplesopencode_get_config() |
| opencode_get_healthA | Health check for the opencode server. Returns basic connectivity status and uptime. Return Format{"success": bool, "message": str, "data": dict} Examplesopencode_get_health() |
| opencode_get_run_statusA | Poll the status of a background agent run. Returns stdout/stderr accumulated so far, status, and exit code. Return Format{"success": bool, "message": str, "data": {"job_id": str, "status": str, "stdout": str, "exit_code": int}} Examplesopencode_get_run_status(job_id="abc123") |
| opencode_list_runsB | List all recent agent runs with their status and exit codes. Return Format{"success": bool, "message": str, "data": {"runs": [{"job_id": str, "status": str, "exit_code": int}]}} Examplesopencode_list_runs(limit=20) |
| opencode_cancel_runA | Cancel a running or queued agent run. Return Format{"success": bool, "message": str, "data": {"job_id": str}} Examplesopencode_cancel_run(job_id="abc123") |
| show_runs_appA | Show recent agent runs as a rich Prefab card. Lists recent opencode agent runs with status badges. Use the plain opencode_runs(action="list") tool when you need raw data instead. Return FormatToolResult with PrefabApp card and plain-text fallback. |
| show_status_appA | Show opencode server status as a rich Prefab card. Displays opencode serve reachability, startup probe result, and job counts. Use opencode_system(action="status") for raw data instead. Return FormatToolResult with PrefabApp card and plain-text fallback. |
| show_sessions_appA | Show opencode sessions as a rich Prefab card. Lists recent opencode sessions. Use opencode_sessions(action="list") for raw data instead. Return FormatToolResult with PrefabApp card and plain-text fallback. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| agent_instructions | Instructions for using opencode-cli-mcp tools effectively. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| Prefab Renderer (show_runs_app) | |
| Prefab Renderer (show_status_app) | |
| Prefab Renderer (show_sessions_app) |
TDQS
Scored across 25 tools
The tool set has severe overlap: opencode_runs duplicates opencode_run_agent, opencode_list_runs, opencode_get_run_status, and opencode_cancel_run via action parameters; opencode_sessions duplicates opencode_list_sessions, opencode_get_session, opencode_send_message, opencode_get_messages, and opencode_session_diff; opencode_system duplicates opencode_launch_ui, opencode_server_status, opencode_list_providers, opencode_get_project, opencode_get_health, and opencode_get_config. These overlapping action-based and individual tools create ambiguity about which to call, despite descriptions.
Names mix conventions: many use opencode_verb_noun (e.g., opencode_list_sessions, opencode_get_config), but others use opencode_noun with action parameters (opencode_runs, opencode_sessions, opencode_depot, opencode_backups, opencode_system), and the show_*_app tools deviate entirely (show_status_app, show_runs_app). This inconsistency across the set makes it hard to predict tool names.
At 25 tools, the server is at the high end of the borderline range for its scope, and many tools are redundant counterparts to the action-based aggregators, inflating the count without adding surface area. However, the domain (opencode CLI management) is broad enough that 25 isn't extreme.
The server covers the major workflows: installing bundles, running agents, inspecting sessions, backups, system status, and viewing rich UI cards. Minor gaps exist (no direct session creation, no config editing), but these can be worked around via existing actions like opencode_send_message or opencode_system.