# Better OpenCode MCP

> An MCP server that lets Claude and other MCP clients delegate tasks to the OpenCode CLI with async execution and multi-model access.

Better OpenCode MCP is a Model Context Protocol server, published by ajhcs as a fork of opencode-mcp-tool, that connects MCP clients such as Claude Code and Claude Desktop to the OpenCode CLI. It lets an AI assistant hand work to OpenCode and use other models, such as Gemini or DeepSeek, through one interface. The latest release listed is v2.0.0.

## What It Is

The project is a bridge between an MCP client and the OpenCode CLI. A client calls the `opencode` tool with a task, and the server starts OpenCode in the background and returns a task ID right away instead of blocking. Users can choose an agent mode (explore, plan or build), override the model, and supply output guidance and a session title.

## Async Task Workflow

Tasks move through the states working, input_required, completed and failed. Companion tools cover the rest of the lifecycle: `opencode_sessions` lists and monitors tasks, `opencode_respond` sends input to a paused task, `opencode_cancel` stops a running one, and `opencode_health` reports on the CLI, configuration, pool and tasks. Utility tools include `ping` and `Help`.

## Setup and Configuration

An interactive `--setup` wizard fetches the models available in OpenCode, lets the user pick primary and fallback models and a default agent, and saves them to a config file. The server resolves the model in this order: CLI flag, config file, the most recently used OpenCode model, an interactive prompt, and finally an error with setup instructions. It requires Node.js 16 or higher and an installed OpenCode CLI, and can be registered with Claude Code or Claude Desktop.

## Reliability Features

The README lists process pooling to limit concurrent child processes, fixes for race conditions in concurrent tool calls, input validation with Zod schemas, process timeouts, task state persisted to disk for crash recovery, and graceful shutdown on SIGINT and SIGTERM. It also documents Windows-specific process handling. The license file is an MIT variant that restricts use to non-commercial purposes. The project describes itself as unofficial and not affiliated with Google or Anthropic.

## Features
- Async task execution with immediate task IDs
- Interactive setup wizard with model auto-detection
- Explore, plan and build agent modes
- Task monitoring, response and cancellation tools
- Process pooling to limit concurrent child processes
- Task state persistence for crash recovery
- Graceful shutdown on SIGINT/SIGTERM
- Health check diagnostics
- Zod input validation and process timeouts
- Per-task model override

## Integrations
OpenCode CLI, Claude Code, Claude Desktop, Google Gemini, DeepSeek, LM Studio

## Platforms
WINDOWS, MACOS, LINUX, API, CLI

## Pricing
Free

## Version
v2.0.0

## Links
- Website: https://github.com/ajhcs/Better-OpenCodeMCP
- Documentation: https://github.com/ajhcs/Better-OpenCodeMCP#readme
- Repository: https://github.com/ajhcs/Better-OpenCodeMCP
- EveryDev.ai: https://www.everydev.ai/tools/better-opencode-mcp
