opencode-cli-mcp
v1.0.1
Published
MCP server wrapping the OpenCode CLI — exposes ping, ask-opencode, search-web, and write-file tools to any MCP client
Maintainers
Readme
opencode-cli-mcp
MCP server wrapping the opencode CLI. Exposes ping, ask-opencode, search-web, and write-file to any MCP client (Claude Code, Kilo, OpenCode, Codex, Cline, etc.).
Prerequisites
- Bun v1.0+
opencodeinstalled and on PATH (or setOPENCODE_PATHenv var)
Installation
npm install -g opencode-cli-mcp
# or
bunx opencode-cli-mcpRegister with Claude Code
claude mcp add opencode-mcp -- npx opencode-cli-mcpEnvironment Variables
| Variable | Default | Description |
|----------|---------|-------------|
| OPENCODE_PATH | opencode | Path to the opencode binary |
| OPENCODE_TIMEOUT_MS | 300000 | Request timeout in ms |
| OPENCODE_WORKSPACE_ROOT | process.cwd() | Workspace root for file operations |
Tools
| Tool | Description |
|------|-------------|
| ping | Health check — shows version and binary path |
| ask-opencode | Run a prompt non-interactively |
| search-web | Web search via opencode |
| write-file | Write files within workspace |
License
MIT
