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 š Onboarding - 5-minute first-run guide š Full reference - tools, endpoints, env vars, architecture
MCP server wrapping opencode CLI's HTTP API (opencode serve) into 22 FastMCP tools (7 primary portmanteaus + 15 legacy aliases). Also includes a FastAPI REST bridge (unified with the MCP endpoint on one port), 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).
š§ Eternal Session Memory ā opencode stores every session since install in one searchable SQLite database. Ask it "what were we discussing last December about X?" ā no other agentic IDE can do that. opencode-cli-mcp makes that memory searchable, exportable, editable, and backed up.
What can you do?
Capability | How |
Wayback session find |
|
Semantic recall (RAG) |
|
Read the past |
|
Edit the past | rename / archive / unarchive / delete sessions (live API or offline depot) |
Never lose it |
|
Run agents |
|
Manage opencode |
|
Related MCP server: MCP Proxy Server
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 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) + unified backend (:10951, REST /api/* + MCP /mcp on one port) + Vite frontend (:10950).
MCP Server Only
uv run -m opencode_cli_mcp.server Configure in Claude Desktop / Cursor / Windsurf (see Integration Guide).
MCP Tools
Primary surface - seven portmanteaus (operation discriminator):
Tool | Purpose |
| start / status / list / cancel agent runs |
| list / get / messages / send / diff / grep / export / rename / delete sessions (live |
| eternal memory - list/archive/unarchive/rename/delete/search/stats over the opencode SQLite DB. Full-text search across EVERY session since install, works offline (no |
| protect the memory - db + config snapshots (consistent online backup API), rotation, disk-space guard, guarded restore (refuses while serve runs unless force=True) |
| status / providers / project / launch_ui / mcp_pulse / config_drift |
| install |
| graceful self-termination |
15 legacy atomic tools remain mounted as aliases through 0.2.x (opencode_run_agent, opencode_get_run_status, opencode_list_runs, opencode_cancel_run, opencode_list_sessions, opencode_get_session, opencode_send_message, opencode_get_messages, opencode_session_diff, opencode_server_status, opencode_list_providers, opencode_get_project, opencode_get_config, opencode_get_health, opencode_launch_ui, plus opencode_session_grep / opencode_export_session / opencode_config_drift / opencode_mcp_pulse).
Prefab in-chat cards: show_runs_app, show_sessions_app, show_status_app.
Eternal Session Memory
opencode records every conversation and agent run since install into one
searchable SQLite database (~/.local/share/opencode/opencode.db). No other
agentic IDE has this ā you cannot ask Claude or Cursor "what were we discussing
last December about santiclaus-mcp?", but you can ask opencode:
opencode_depot(action="search", query="santiclaus") # wayback find - full-text across ALL transcripts
opencode_depot(action="rag", query="santiclaus") # semantic recall - embeddings over indexed transcripts
opencode_depot(action="rag_index") # build the RAG index (once)
opencode_sessions(action="get", session_id="ses_...") # metadata
opencode_sessions(action="messages", session_id="ses_...") # the transcript
opencode_sessions(action="export", session_id="ses_...") # markdown/html document
opencode_backups(action="create", kind="all") # protect it (autobackup 24h)Full walkthrough: docs/ETERNAL_MEMORY.md (also on the webapp Help page and Depot page).
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 |
5-minute first-run guide | |
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 | |
Version history |
Stack
Backend: Python 3.12+, FastMCP 3.4.4, FastAPI, uvicorn, httpx, pydantic v2, prefab-ui, psutil, SQLite (job store)
Frontend: React 18, Vite 5, TypeScript, TailwindCSS 3.4, Zustand, Framer Motion, Lucide, React Router, @tauri-apps/api
Native: Tauri 2 (NSIS installer, embedded PyInstaller backend)
Quality: ruff, biome, pytest (+coverage), Playwright e2e, pre-commit, just
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)
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server that wraps CubeCoders AMP to list, inspect, and control game-server instances.Last updated83MIT
- Alicense-qualityBmaintenanceAggregates multiple backend MCP servers into a single unified interface with optional web management UI for tool control and configuration.Last updated71192MIT
- FlicenseBqualityBmaintenanceProvides MCP tools for querying LinkYun operations metrics, including listing metrics, querying metrics, managing agents, and home recommendations, by forwarding requests to the LinkYun Agent Ops HTTP API.Last updated15
- Alicense-qualityAmaintenanceAggregates multiple MCP servers into a single HTTP endpoint with tool namespacing, dashboard, and REST API for management.Last updated34MIT
Related MCP Connectors
An MCP server that let you interact with Cycloid.io Internal Development Portal and Platform
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
MCP server for the FFmpeg Micro video transcoding API ā create, monitor, download transcodes.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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