opencode-cli-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@opencode-cli-mcprun agent to analyze the current project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
opencode-cli-mcp
MCP server that wraps opencode CLI's HTTP API (opencode serve) into MCP tools, plus a SOTA fleet-standard webapp dashboard.
Quick Start
.\start.ps1 # OpenCode serve + API + frontend
uv run -m opencode_cli_mcp.server # MCP server only (stdio)Requires: opencode CLI (npm i -g opencode-ai), Python 3.12+, Node.js 18+.
MCP Tools (14 atomic)
Tool | Purpose |
| Launch agent (background or blocking) |
| Poll running agent for progress |
| List all agent runs |
| Cancel a stuck run |
| List opencode sessions |
| Session details |
| What files changed in a session |
| Files touched in a session |
| Export session as JSON |
| Continue a running session |
| Session transcript |
| Server health + config |
| Configured LLM providers |
| Active project context |
Async Workflow (recommended)
opencode_run_agent(prompt="refactor main.py", wait=false)
→ { job_id: "abc123" }
opencode_get_run_status("abc123") # poll until completed
→ { status: "completed", stdout: "...", exit_code: 0 }
opencode_session_diff("session-xyz") # review changes
→ { diff: { created: [...], modified: [...], deleted: [...] } }Architecture
MCP hosts → opencode-cli-mcp (FastMCP 3.2, stdio)
↕ httpx
opencode serve (HTTP :4096)Ports
Port | Service |
10950 | Frontend (Vite) |
10951 | Backend (FastAPI) |
4096 | opencode serve |
Security
This MCP server runs arbitrary shell commands (opencode run) from LLM prompts.
Only install and use in environments where you trust your MCP client (Claude Desktop,
Cursor, etc.) and the models it uses.
Fleet
Registered in
mcp-central-docs: ports 10950/10951Start script:
.\start.ps1(supports-Headless)Glama:
glama.jsonin repo root
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/sandraschi/opencode-cli-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server