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
📖 Installation Guide — quick start, manual setup, and troubleshooting
MCP server wrapping opencode CLI's HTTP API (opencode serve) into 14 FastMCP tools. Also includes a FastAPI REST bridge, a Vite/React fleet-standard dashboard, and OpenCode custom tools that extend opencode itself.
Pattern: Plan with Claude, implement with opencode. Claude (expensive, high-judgment) orchestrates and supervises; opencode handles implementation grunt work on cheaper models (DeepSeek V4 Flash/Pro).
Quick Start
git clone https://github.com/sandraschi/opencode-cli-mcp
cd opencode-cli-mcp
justThis opens an interactive dashboard showing all available commands. Run just bootstrap to install dependencies, then just serve or just dev to start.
Manual Setup
If you don't have just installed:
Prerequisites
opencodeCLI:npm i -g opencode-aiPython 3.12+
Node.js 18+
Run Everything
.\start.ps1
Starts: opencode serve (:4096) + FastAPI backend (:10951) + Vite frontend (:10950).
MCP Server Only
uv run -m opencode_cli_mcp.server Configure in Claude Desktop / Cursor / Windsurf (see Integration Guide).
14 MCP Tools
Tool | Purpose |
| Launch agent (background or blocking) |
| Poll running agent |
| List all agent runs |
| Cancel a stuck run |
| List opencode sessions |
| Session details |
| Files changed in a session |
| Files touched in a session |
| Export session as JSON |
| Continue a session |
| Session transcript |
| Server health + config |
| Configured LLM providers |
| Active project context |
Key Workflows
See Usage Guide for full details.
Basic: Launch -> Poll -> Review
opencode_run_agent(prompt="refactor main.py", wait=false)
-> { job_id: "abc" }
opencode_get_run_status("abc") -> poll until completed
opencode_session_diff("session-xyz") -> review changesMulti-Agent Sweep
Launch N agents across N repos in parallel, poll all, review diffs. Designed for fleet-wide operations.
Interactive Supervision
Start an agent, read its messages mid-task, send corrections, review final diff.
OpenCode Custom Tools
Copy .opencode/tools/*.ts into your opencode project to give opencode's LLM direct access to MCP fleet management, session inspection, and system diagnostics. 6 tools covering fleet, sessions, runs, system, providers, and tool discovery. See the OC Tools page in the webapp for full documentation and source.
Documentation
Doc | Description |
All tools, workflows, async patterns, webapp pages | |
MCP client config (Claude Desktop, Cursor, Windsurf) | |
Async patterns, session management, cross-project, custom tools | |
Known issues and roadmap | |
Architecture review and bug audit | |
Version history |
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 in environments where you trust your MCP client (Claude Desktop, Cursor) and the models it uses.
Fleet
Registered in
mcp-central-docs: ports 10950/10951fleet-registry.jsonandglama.jsonin repo rootWebapp dashboard:
http://localhost:10950(run.\start.ps1)
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