MCP server for OpenCode AI — 70 tools, 10 resources, 5 prompts. Use npx opencode-mcp with Claude Desktop, Claude Code, Cursor, Windsurf, or any MCP client.
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"opencode": {
"args": [
"-y",
"opencode-mcp"
],
"command": "npx"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
Give any MCP client the power of OpenCode.
This server supports HTTP transport. Be the first to test it — help the community know if it works.
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
Checked opencode-mcp against OSV.dev.
Click any tool to inspect its schema.
current_projectCurrent active project
opencode://project/current
configCurrent configuration
opencode://config
providersProviders with models
opencode://providers
agentsAvailable agents
opencode://agents
commandsAvailable commands
opencode://commands
healthServer health and version
opencode://health
vcsVersion control info
opencode://vcs
sessionsAll sessions
opencode://sessions
mcp_serversMCP server status
opencode://mcp-servers
file_statusVCS file status
opencode://file-status
opencode-code-reviewReview diffs from a session
opencode-debugStep-by-step debugging workflow
opencode-project-setupGet oriented in a new project
opencode-implementHave OpenCode build a feature
opencode-best-practicesSetup, tool selection, monitoring, and pitfalls
opencode-session-summarySummarize what happened in a session
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in developer-tools / ai-ml
Dynamic problem-solving through sequential thought chains
A Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
Context7 Platform -- Up-to-date code documentation for LLMs and AI code editors
XcodeBuildMCP provides tools for Xcode project management, simulator management, and app utilities.
MCP Security Weekly
Get CVE alerts and security updates for Opencode Mcp and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
Give any MCP client the power of OpenCode.
opencode-mcp is an MCP server that bridges your AI tools (Claude, Cursor, Windsurf, VS Code, etc.) to OpenCode's headless API. It lets your AI delegate real coding work — building features, debugging, refactoring, running tests — to OpenCode sessions that autonomously read, write, and execute code in your project.
80 tools | 10 resources | 6 prompts | Multi-project | Auto-start
@opencode-ai/sdk if one isn't already running. No manual steps.Prerequisite: OpenCode must be installed.
curl -fsSL https://opencode.ai/install | bashornpm i -g opencode-aiorbrew install sst/tap/opencode
Claude Code:
claude mcp add opencode -- npx -y opencode-mcp
Claude Desktop / Cursor / Windsurf / Cline / Continue (add to your MCP config):
{
"mcpServers": {
"opencode": {
"command": "npx",
"args": ["-y", "opencode-mcp"]
}
}
}
That's it. Restart your client and OpenCode's tools will be available.
See Configuration for all client configs (VS Code Copilot, Zed, Amazon Q, etc.) and environment variables.
MCP Client <--stdio--> opencode-mcp <--HTTP--> OpenCode Server
(Claude, Cursor, etc.) (this package) (in-process via @opencode-ai/sdk,
or external opencode serve)
Your MCP client calls tools over stdio. This server translates them into HTTP requests to the OpenCode headless API. If no OpenCode server is reachable at OPENCODE_BASE_URL, one is started in-process via the official @opencode-ai/sdk. The directory parameter on every tool routes that request to a specific project via the x-opencode-directory header, so a single MCP instance can fan out across many project roots.
The 80 tools are organized into tiers. Start with the workflow tools — they handle the common patterns in a single call.
| Tool | What it does |
|---|---|
opencode_setup | Check server health, providers, and project status. Use first. |
opencode_ask | Create session + send prompt + get answer. One call. |
opencode_reply | Follow-up message in an existing session |
opencode_run | Send a task and wait for completion (session + async send + polling) |
opencode_fire | Fire-and-forget: dispatch a task, return immediately |
opencode_check | Compact progress report for a running session (status, todos, files changed) |
opencode_conversation | Get formatted conversation history |
opencode_sessions_overview | Quick overview of all sessions |
opencode_context | Project + VCS + config + agents in one call |
opencode_review_changes | Formatted diff summary for a session |
opencode_wait | Poll an async session until it finishes |
opencode_provider_test | Quick-test whe |