Overview
Connect CodeAlive with OpenCode — an open-source AI coding assistant that runs in your terminal. OpenCode uses its own JSON configuration format with atype: remote transport for HTTP connections.
Prerequisites
- OpenCode installed (github.com/opencode-ai/opencode)
- CodeAlive account (Sign up here)
- Indexed repositories in your CodeAlive dashboard
Setup
1
Locate Config File
OpenCode reads configuration from
opencode.json in your project root or home directory.2
Add CodeAlive Server
Add this to your OpenCode discovers OAuth automatically. Restart OpenCode and follow the browser prompt, or run
opencode.json:opencode mcp auth codealive explicitly.OpenCode uses
type: "remote" for HTTP-based MCP servers, which is different from most other clients that use type: "http" or type: "streamable-http".Existing API-key configurations remain supported. To use one intentionally, set
"oauth": false and add an Authorization: Bearer ... header.3
Restart OpenCode
Restart OpenCode to load the new MCP configuration.
4
Verify Integration
Try these commands with OpenCode:
- “Show me all available repositories”
- “Find authentication code in my codebase”
- “Explain how the payment flow works”
Docker Alternative
If you prefer running the MCP server locally:Usage
Once connected, OpenCode can:- Search your codebase semantically across all indexed repositories
- Answer architecture questions with full project context
- Find patterns and implementations across multiple services
Troubleshooting
MCP server not detected
MCP server not detected
- Verify the config file is named
opencode.json - Check that
typeis set to"remote"(not"http") - Ensure
"enabled": trueis set - Restart OpenCode
Authentication errors
Authentication errors
- Run
opencode mcp auth codealive - Inspect discovery with
opencode mcp debug codealive - If you intentionally use the API-key fallback, verify the key is active and set
"oauth": false
Connection timeouts
Connection timeouts
- Check your network connection
- Try the Docker STDIO option for local access
- Verify the URL is
https://mcp.codealive.ai/api
Related Resources
Instruct Your Agent
Connecting CodeAlive makes its tools available, but the agent may still default to its built-in search. For reliable results, add a short instruction in the agent’s native format telling it to prefersemantic_search and grep_search when exploring indexed code. See Instructing Coding Agents.