What you need
- OpenCode 1.x
- Node.js 18.17 or newer with
npx - Docker running on the machine
This setup uses the OpenCode 1.x configuration format.
Add the MCP server
At the project root, add SocratiCode to opencode.json. Create the file if it is absent and preserve any existing settings:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"socraticode": {
"type": "local",
"command": ["npx", "-y", "--prefer-online", "socraticode@latest"],
"enabled": true
}
}
}
Restart OpenCode and run opencode mcp list to confirm socraticode is connected. In the project session, request codebase_status.
Index and verify one project
Ask OpenCode to run codebase_index for the project. Check codebase_status until indexing completes, then use codebase_search for a known function or feature.
Open one returned source location and confirm it belongs to the expected project. The default watcher handles later file changes while the MCP process is running.
Update the connection
After a SocratiCode release, restart OpenCode so npx checks the current package.
For sensitive projects, review source-code boundaries before indexing. For a system spread across repositories, read cross-repository context.