Claude-Opencode-mcp
Click on "Deploy 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., "@Claude-Opencode-mcp Implement the login endpoint in /src/auth and run the tests."
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.
Claude Desktop → OpenCode CLI Development Bridge MCP
A local Model Context Protocol (MCP) server that connects Claude Desktop (Planner / Architect) to OpenCode CLI (Coding Engineer / Executor) via standard input/output (stdio) transport.
1. Architecture
USER
│
CLAUDE DESKTOP
PLANNER/ARCHITECT
│
dynamic prompt
│
MCP SERVER
BRIDGE
│
┌──────────┴──────────┐
▼ ▼
IDE Launcher OPENCODE CLI
(VS Code / Antigravity) CODING ENGINEER
│
┌─────────────────────┼─────────────────────┐
▼ ▼ ▼
Files Terminal Tests
│ │ │
└─────────────────────┼─────────────────────┘
│
LOCAL PROJECT
│
REAL EXECUTION
│
PASS / PARTIAL / FAIL
│
MCP SERVER
│
CLAUDE DESKTOP
│
next engineering instructionKey Principles
Claude Desktop is the Planner/Architect: Requirements analysis, architectural design, task decomposition, and reviewing execution feedback.
OpenCode CLI is the Coding Engineer: Inspects the workspace, writes/edits code, executes commands, builds projects, runs automated tests, and fixes implementation errors.
MCP Server is the Bridge: Handles environment verification, opens workspaces in VS Code or Antigravity IDE when requested, launches OpenCode CLI process as a local subprocess, parses output/session events, and returns execution feedback.
Related MCP server: opencode-executor-mcp
2. Requirements
Operating System: Windows 10/11, macOS, or Linux
Python: Version 3.10 or higher
OpenCode CLI: Installed globally (
npm install -g opencode-aior similar)Target IDE (Optional): VS Code (
code) or Antigravity IDE (antigravity-ide)
3. Installation
Step 1: Navigate to Project Directory
cd "d:\AI tools\MCP's\Claude-Opencode"Step 2: Create & Activate Virtual Environment
python -m venv .venv
.\.venv\Scripts\Activate.ps1Step 3: Install Package
pip install -r requirements.txt
pip install -e .4. Claude Desktop Configuration
Locate your Claude Desktop configuration file:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Add the opencode server configuration:
{
"mcpServers": {
"opencode": {
"command": "d:\\AI tools\\MCP's\\Claude-Opencode\\.venv\\Scripts\\python.exe",
"args": [
"-m",
"antigravity_mcp.server"
],
"env": {
"PYTHONPATH": "src",
"DEFAULT_IDE": "cli_direct",
"OPENCODE_PATH": "C:\\Users\\LENOVO\\AppData\\Roaming\\npm\\opencode.cmd",
"VSCODE_PATH": "C:\\Users\\LENOVO\\AppData\\Local\\Programs\\Microsoft VS Code\\bin\\code.cmd",
"ANTIGRAVITY_PATH": "D:\\AI tools\\Antigravity\\Antigravity IDE\\bin\\antigravity-ide.cmd"
}
}
}
}Path Overrides
If Claude Desktop does not inherit your full environment PATH, configure explicit executable paths:
OPENCODE_PATH: Path toopencode/opencode.cmd/opencode.exeVSCODE_PATH: Path tocode.cmd/code.exeANTIGRAVITY_PATH: Path toantigravity-ide.cmdDEFAULT_IDE: Preferred execution environment (cli_direct,vs_code,antigravity)
5. Primary MCP Tools
Tool Name | Parameters | Description |
|
| Primary Engineering Tool. Forwards dynamic engineering instructions to OpenCode CLI in target workspace. Returns structured execution status ( |
|
| Continue an active OpenCode session using real OpenCode session ID ( |
|
| Open workspace directory in VS Code or Antigravity IDE. |
| None | Check OpenCode CLI installation, version, and IDE environment status. |
Backward compatibility aliases (delegate_to_antigravity, ask_antigravity, continue_antigravity, open_antigravity_workspace) are also provided and route directly to OpenCode CLI.
6. Testing
To run the complete test suite:
$env:PYTHONPATH="src"; .venv\Scripts\python.exe -m pytestTo run with live OpenCode CLI LLM execution smoke tests:
$env:PYTHONPATH="src"; $env:RUN_REAL_OPENCODE_SMOKE="1"; .venv\Scripts\python.exe -m pytestClaude-Opencode-mcp
Available Tools
15 toolsask_antigravityD
Alias for delegate_to_opencode.
Inputs: prompt (required). Returns: result
continue_antigravityD
Alias for continue_opencode.
Inputs: prompt (required), interaction_id (required), workspace_path. Returns: result
continue_opencodeA
Continue an active OpenCode engineering session while preserving session context.
Use this tool to send follow-up instructions, fix build/test failures, or proceed to the next engineering task in the development loop.
Args: interaction_id: The OpenCode session ID of the previous interaction session to continue. prompt: Dynamic follow-up instruction generated by Claude Desktop. workspace_path: Local workspace directory path. ide: Optional IDE environment preference ('vs_code', 'antigravity', or 'cli_direct').
Inputs: prompt (required), interaction_id (required), workspace_path (required), ide. Returns: result
delegate_to_antigravityC
Alias for delegate_to_opencode.
Inputs: prompt (required), workspace_path. Returns: result
delegate_to_opencodeA
Delegate a real-time software engineering instruction to OpenCode CLI.
Claude Desktop acts as the Planner and Architect. OpenCode CLI acts as the Coding Engineer. The dynamic prompt is forwarded unchanged to OpenCode executing in the target workspace.
Args: prompt: Dynamic, real-time natural language engineering instruction generated by Claude. workspace_path: Absolute or relative local workspace directory path. ide: Optional IDE environment preference ('vs_code', 'antigravity', or 'cli_direct').
Inputs: prompt (required), workspace_path (required), ide. Returns: result
diagnose_antigravity_workspaceC
Run project diagnostics in local workspace.
Inputs: path (required). Returns: result
fix_antigravity_workspaceC
Apply targeted file write within workspace boundary.
Inputs: content (required), relative_path (required), workspace_path (required). Returns: result
get_antigravity_statusB
Alias for get_opencode_status.
Inputs: no named parameters. Returns: result
get_antigravity_workspaceB
Query currently active workspaces in local IDE.
Inputs: no named parameters. Returns: result
get_opencode_statusA
Check OpenCode CLI executable availability, version, and IDE readiness.
Inputs: no named parameters. Returns: result
inspect_antigravity_workspaceC
Inspect local workspace directory structure and manifest files.
Inputs: path (required). Returns: result
launch_antigravity_workspaceC
Launch application in workspace using detected launcher.
Inputs: path (required). Returns: result
open_antigravity_workspaceC
Alias for open_workspace_in_ide with Antigravity IDE.
Inputs: path (required). Returns: result
open_workspace_in_ideB
Open an existing workspace directory in VS Code or Antigravity IDE.
Args: workspace_path: Directory path of the workspace to open. ide: Target IDE ('vs_code' or 'antigravity'). Defaults to configured default IDE.
Inputs: workspace_path (required), ide. Returns: result
read_antigravity_workspace_fileC
Safely read content of a workspace file.
Inputs: relative_path (required), workspace_path (required), max_lines. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Several tools are explicit aliases for the same operation, such as delegate_to_opencode/delegate_to_antigravity/ask_antigravity, get_opencode_status/get_antigravity_status, continue_opencode/continue_antigravity, and open_workspace_in_ide/open_antigravity_workspace. This creates serious ambiguity because an agent can select multiple different tool names to perform the same action, and the remaining antigravity workspace tools also have overlapping file/diagnostic boundaries.
There is no consistent naming pattern across the set: some tools use verb_to_target like delegate_to_opencode, others are target-prefixed like get_antigravity_status, and others are generic like open_workspace_in_ide. Aliases also have divergent names such as ask_antigravity, making the convention even less predictable.
15 tools is on the higher side for a single integration server, and the presence of at least five aliases makes the count feel padded rather than purposeful. However, once aliases are removed, the remaining unique session and workspace operations are roughly reasonable for the stated scope.
The core workflow of delegating to OpenCode, continuing sessions, checking status, opening workspaces, inspecting files, and running diagnostics is well covered. Minor gaps such as no session listing or cancellation can be worked around using returned interaction IDs and workspace queries.
Related MCP Connectors
Sync coding-agent sessions and resume them in any other agent: Claude Code, Codex, Cursor, more.
Source-checked CLI guides and model-aware planning for Claude Code, Codex, and Grok Build.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
People and AI agents build software together in persistent cloud sessions for Claude Code.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceEnables ISLI agents and MCP clients to dispatch natural-language coding and terminal tasks to a locally-installed Claude Code CLI, supporting both one-shot execution and persistent sessions with workspace and security controls.-
- AlicenseNot gradedqualityDmaintenanceEnables Claude Code to delegate prompts to an OpenCode agent session for cheaper executor-role work, supporting different providers and session persistence.ISC
- AlicenseAqualityDmaintenanceEnables Codex to delegate coding tasks to an OpenCode CLI locally, returning structured results such as exit codes, session summaries, tool calls, and git diffs.2MIT
- AlicenseNot gradedqualityCmaintenanceEnables Claude Code and Claude Desktop to delegate coding tasks to any model available in OpenCode while Claude remains the orchestrator, planning work, reviewing diffs, and running tests. Supports synchronous and async delegation, model selection, session continuation, and permission-aware execution.6MIT