OpenCode¶
Official docs:
Config Files¶
Project scope:
opencode.json
Global scope:
~/.config/opencode/opencode.json
Project config overrides global config.
Example Config¶
OpenCode uses the mcp key instead of mcpServers and expects local MCP
servers to declare type: "local" with a command array:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"tubebrain": {
"type": "local",
"command": ["tubebrain"],
"enabled": true
}
}
}
If tubebrain is not on PATH, use an absolute path inside the command array.
Verify¶
Start OpenCode and confirm tubebrain is available as a tool.
Notes¶
- OpenCode merges config sources rather than replacing them outright.
- MCP entries become tools in OpenCode, so they can also be enabled or disabled
via the
toolssection if you later need tighter agent-specific control. - Remote MCP servers use a different shape with
type: "remote"andurl, buttubebrainis a local stdio server.