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": {
"yt-text": {
"type": "local",
"command": ["yt-text"],
"enabled": true
}
}
}
If yt-text is not on PATH, use an absolute path inside the command array.
Verify¶
Start OpenCode and confirm yt-text 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, butyt-textis a local stdio server.