opencode-mcp
About
An MCP (Model Context Protocol) server that lets Claude Code drive an OpenCode instance and delegate work to its subagents — so orchestrator models like Opus or Fable can hand off tasks to the other models OpenCode exposes.
Details
- Author
- alejandro-technology
- Categories
- Developer Tools, AI, Automation
Jump to
Setup
Install opencode-mcp in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/alejandro-technology/opencode-mcp
Follow the installation instructions in the repository README, then restart your MCP client.
An MCP (Model Context Protocol) server that lets any MCP host — Claude Code, Codex, Cursor, etc. — drive anOpenCodeinstance and delegate work to its subagents — so orchestrator models like Opus or Fable can hand off tasks to the other models OpenCode exposes.
RequiresNode.js 18+andOpenCodeinstalled and configured (opencodemust be on yourPATH, with at least one provider/model set up) — this server spawns and drives OpenCode instances.
claude mcp add opencode -- npx -y mcp-server-opencode
codex mcp add opencode -- npx -y mcp-server-opencode
SeeInstallationfor manual config, and from-source options.
Task delegation isasynchronous: starting a task returns immediately with atask_idinstead of blocking until the subagent finishes. This lets Claude Code fire multipleopencode_start_taskcalls in parallel — each one opens an isolated OpenCodeSession— without hitting MCP client timeouts on long-running work. Status and results are fetched separately via polling.
- Node.js 18+
- OpenCodeinstalled and configured (opencodemust be on yourPATH, with at least one provider/model set up) — this server spawns and drives OpenCode instances.
The package is published asmcp-server-opencode. No cloning or building needed — point your MCP host atnpx:
claude mcp add opencode -- npx -y mcp-server-opencode
{ "mcpServers": { "opencode": { "command": "npx", "args": ["-y", "mcp-server-opencode"] } } }
ForCodex, add the server to~/.codex/config.toml:
[mcp_servers.opencode] command = "npx" args = ["-y", "mcp-server-opencode"]
Or install it globally and use the binary directly:
{ "mcpServers": { "opencode": { "command": "opencode-mcp" } } }
git clone https://github.com/alejandro-technology/opencode-mcp.git cd opencode-mcp pnpm install pnpm build
Then point your MCP host at the built entrypoint:
{ "mcpServers": { "opencode": { "command": "node", "args": ["/path/to/opencode-mcp/build/src/index.js"] } } }
Restart your MCP host after editing the config; theopencode_tools should appear in its tool list.
opencode_wait_for_taskaccepts atimeout_msinput, but it's clamped to a server-side maximum so a single call can't block the MCP connection indefinitely. That maximum defaults to300000 ms (5 minutes)and is configurable viaMCP_TOOL_TIMEOUT.
-
Environment variable— set it in the MCP server config:
{ "mcpServers": { "opencode": { "command": "node", "args": ["/path/to/opencode-mcp/build/src/index.js"], "env": { "MCP_TOOL_TIMEOUT": "1200000" } } } }
CLI argument— passMCP_TOOL_TIMEOUT=<ms>as an extra arg to the server process:
{ "mcpServers": { "opencode": { "command": "node", "args": [ "/path/to/opencode-mcp/build/src/index.js", "MCP_TOOL_TIMEOUT=1200000" ] } } }
If both are present, theenvironment variable takes precedenceover the CLI argument. Invalid or non-numeric values fall back to the 300000 ms default.
src/ ├── index.ts # MCP server entrypoint (stdio transport, shutdown handlers) └── modules/ ├── tools/ # One file per MCP tool, registered in index.ts ├── prompts/ # One file per MCP prompt, registered in index.ts └── shared/ # Cross-tool infrastructure ├── server-registry.ts # Tracks running OpenCode servers; killAllServers() on shutdown ├── task-registry.ts # Maps task_id → OpenCode server + session ├── opencode-client.ts # Builds SDK clients from the registries ├── config.ts # MCP_TOOL_TIMEOUT resolution (env var / CLI arg) └── mcp-result.ts # jsonResult / jsonError MCP output helpers
Each module ships with a.test.tsVitest suite under the paralleltests/tree mirroringsrc/.
pnpm install pnpm dev # runs the server through the MCP Inspector (tsx, no build needed)
pnpm test # vitest run pnpm test:coverage # vitest run --coverage pnpm lint # biome check pnpm lint:write # biome check --write pnpm build # clean tsc build to ./build (also the typecheck)
This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.
Agent-native developer Q&A API with MCP + A2A endpoints for citations, job pickup, and answer submission.
MCP bridge that lets Claude Code delegate heavy tasks to the Antigravity CLI (agy) — purpose-built tools, model routing with fallback, session continuity, and output truncation to save Claude's context and tokens.
Embeds intelligent guidance into AI workflows to organize development and ensure quality.
Open-source AI coding stack — bundled MCP servers, agent runtime, and developer tooling for shipping AI-native dev tools.
Local agent workbench bundling OpenHands, Goose, Aider, and ashlrcode against one local LLM, with ashlr-plugin MCP servers pre-wired.
Async Parallel Antigravity for Codex & Claude Code
Run parallel, resumable, human-operable Antigravity CLI sessions from Codex, Claude Code, or any MCP-capable agent harness.
knowledge network for AI coding agents. Developers connect their agents to a shared pool of verified solutions — saving tokens, reducing debugging time, and getting better results. Solution authors earn when their work helps others.
Orchestrates multiple Claude Code agents across iTerm2 sessions, providing centralized management and inter-agent communication.
Multi-LLM Design and Build Team. Confer and create with a team of LLMs.
An MCP server for initial app planning and creating a good starting point for an app.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.


