OpenCode MCP
Enables AI assistants to interact with multiple AI models through the OpenCode CLI with a unified interface. Supports plan mode for structured analysis, flexible model selection, and natural language queries with file references.
What is OpenCode MCP?
OpenCode MCP is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to enables ai assistants to interact with multiple ai models through the opencode cli with a unified interface. supports plan mode for structured analysis, flexible model selection, and natural language ...
Enables AI assistants to interact with multiple AI models through the OpenCode CLI with a unified interface. Supports plan mode for structured analysis, flexible model selection, and natural language queries with file references.
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Enables AI assistants to interact with multiple AI models th
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx opencode-mcp-toolConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use OpenCode MCP
OpenCode MCP Tool bridges AI assistants like Claude to the OpenCode CLI, letting you query multiple AI models (Gemini, GPT, and others) through a unified interface. It provides plan mode for structured analysis, build mode for immediate execution, and brainstorming frameworks — all without leaving your AI assistant.
Prerequisites
- Node.js 18+ and npx available on your PATH
- OpenCode CLI installed and configured (opencode.ai)
- At least one AI provider API key configured in OpenCode (e.g., Google Gemini, OpenAI)
- Claude Desktop or another MCP-compatible client
Install OpenCode CLI
OpenCode MCP Tool delegates queries to the OpenCode CLI, so you must install and authenticate it first. Follow the setup at opencode.ai and configure at least one model provider.
npm install -g opencode-aiAdd the MCP server via Claude CLI
Use the Claude CLI shortcut to register the MCP server. This command starts the server on demand via npx, passing your preferred default model as a flag.
claude mcp add opencode -- npx -y @gilby125/opencode-mcp-tool -- --model google/gemini-2.5-proConfigure Claude Desktop manually
Alternatively, edit your Claude Desktop config file to add the server. Adjust the --model flag to any model string supported by OpenCode.
Verify connectivity with ping
Ask Claude to run the ping tool to confirm the MCP server is reachable before attempting real queries.
Run your first cross-model query
Use the ask-opencode tool through natural language. You can reference local files using @ prefixes and choose plan or build mode per request.
OpenCode MCP Examples
Client configuration
Add to claude_desktop_config.json to run the server via npx with Gemini 2.5 Pro as the default model.
{
"mcpServers": {
"opencode": {
"command": "npx",
"args": ["-y", "@gilby125/opencode-mcp-tool", "--", "--model", "google/gemini-2.5-pro"]
}
}
}Prompts to try
Use these prompts in Claude after the server is configured.
- "Use opencode to explain the architecture in @src/index.ts"
- "Ask opencode in plan mode to design a caching layer for this API"
- "Use opencode to analyze @src/main.js and suggest performance improvements"
- "Ask opencode to brainstorm product ideas using the divergent thinking framework"Troubleshooting OpenCode MCP
The server starts but OpenCode queries time out
OpenCode may be slow on first run while it downloads model metadata. The server has a startup_timeout_sec of 20 and tool_timeout_sec of 300 — large codebases may need the CLI pre-warmed by running opencode manually once first.
Error: model not found or provider not configured
The --model flag must match a provider you have configured in OpenCode. Run opencode --list-models to see available options and update the args array in your config accordingly.
npx fails with ENOENT or permission errors
Ensure Node.js 18+ is installed and npx is on your PATH. On macOS you may need to launch Claude Desktop from a terminal that has your PATH set correctly, or use the absolute path to npx in the command field.
Frequently Asked Questions about OpenCode MCP
What is OpenCode MCP?
OpenCode MCP is a Model Context Protocol (MCP) server that enables ai assistants to interact with multiple ai models through the opencode cli with a unified interface. supports plan mode for structured analysis, flexible model selection, and natural language queries with file references. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install OpenCode MCP?
Follow the installation instructions on the OpenCode MCP GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with OpenCode MCP?
OpenCode MCP works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is OpenCode MCP free to use?
Yes, OpenCode MCP is open source and available under the NOASSERTION license. You can use it freely in both personal and commercial projects.
OpenCode MCP Alternatives — Similar Developer Tools Servers
Looking for alternatives to OpenCode MCP? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up OpenCode MCP in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use OpenCode MCP?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.