OpenCode MCP

v1.0.0Developer Toolsstable

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.

opencode-mcp-toolmcpai-integration
Share:
8
Stars
0
Downloads
0
Weekly
0/5

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

Interact with multiple AI models through unified OpenCode CLI.
Use structured analysis mode with flexible model selection.
gilby125

Maintainer

LicenseNOASSERTION
Languagetypescript
Versionv1.0.0
UpdatedMay 19, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx opencode-mcp-tool

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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-ai
2

Add 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-pro
3

Configure 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.

4

Verify connectivity with ping

Ask Claude to run the ping tool to confirm the MCP server is reachable before attempting real queries.

5

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.

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.

Quick Config Preview

{ "mcpServers": { "opencode-mcp-tool": { "command": "npx", "args": ["-y", "opencode-mcp-tool"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides