Skip to content

OpenCode

OpenCode uses a single opencode.json file in the project root for all configuration, including MCP servers.

Terminal window
cce init # Auto-detects OpenCode if opencode.json exists
cce init --agent all # Explicitly includes OpenCode

CCE adds its MCP server entry to the existing opencode.json (or creates one if it does not exist).

{
"mcp": {
"context-engine": {
"type": "local",
"command": ["cce", "serve", "--project-dir", "/path/to/your/project"]
}
}
}

Note: OpenCode uses "mcp" as the servers key, with "type": "local" and "command" as an array (not a string with separate "args").

OpenCode does not use a separate instruction file. The MCP server registration is sufficient for OpenCode to discover and use CCE’s tools.

  1. Start an OpenCode session after running cce init
  2. The context_search tool should be available
  3. Ask a code question and check the tool output for context_search calls
  4. Run cce savings to check if queries are being tracked

Check that opencode.json exists in your project root and contains the context-engine entry. If you have an existing opencode.jsonc (with comments), CCE merges into that file.

Ensure cce is on your PATH. If installed with uv tool install, add ~/.local/bin to your shell profile.