OpenCode MCP setup uses mcp.servers, not Gemini mcpServers
Answer: To configure an OpenCode server by hand, give it a unique name under mcp.servers. Gemini CLI uses a top-level mcpServers object in settings.json.
OpenCode
A local server is a command started over MCP stdio. A remote server uses a URL. opencode mcp add writes project configuration; --global makes it available across projects. Use opencode mcp list to check the connection.
Configured servers connect automatically. Use disabled, not an enabled field, to retain configuration without connecting. A higher-precedence project configuration replaces the whole server object with the same name.
Gemini CLI
Its per-server includeTools and excludeTools lists filter tools exposed by the server; excludeTools takes precedence over includeTools.
See also
Claims
- id: C1 claim: OpenCode V2 uses mcp.servers for named servers. source: S1 evidence: "give it a unique name under
mcp.servers"
- id: C2 claim: OpenCode uses disabled to avoid connecting. source: S1 evidence: "Use
disabled, not anenabledfield,"
- id: C3 claim: Gemini CLI uses mcpServers in settings.json. source: S2 evidence: "Gemini CLI uses the
mcpServersconfiguration in yoursettings.jsonfile"
- id: C4 claim: Gemini tool exclusions take precedence. source: S2 evidence: "
excludeToolstakes precedence overincludeTools."
Sources
- [S1] MCP servers (OpenCode docs). anomalyco/opencode (GitHub). https://github.com/anomalyco/opencode/blob/dev/services/site/src/docs/content/mcp-servers.mdx . License: MIT. Accessed 2026-11-16.
- [S2] MCP servers with the Gemini CLI. google-gemini/gemini-cli (GitHub). https://github.com/google-gemini/gemini-cli/blob/main/docs/tools/mcp-server.md . License: Apache-2.0. Accessed 2026-11-16.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: anomalyco/opencode (GitHub), MCP servers (OpenCode docs), MIT (https://raw.githubusercontent.com/anomalyco/opencode/dev/LICENSE). Copyright (c) 2025 opencode; google-gemini/gemini-cli (GitHub), MCP servers with the Gemini CLI, Apache-2.0 (https://raw.githubusercontent.com/google-gemini/gemini-cli/main/LICENSE). Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: anomalyco/opencode (GitHub), MCP servers (OpenCode docs), MIT (https://raw.githubusercontent.com/anomalyco/opencode/dev/LICENSE). Copyright (c) 2025 opencode; google-gemini/gemini-cli (GitHub), MCP servers with the Gemini CLI, Apache-2.0 (https://raw.githubusercontent.com/google-gemini/gemini-cli/main/LICENSE).
Cite this
iinventedlight. 2026. "OpenCode MCP setup uses mcp.servers, not Gemini mcpServers." iinventedlight Library, iil:note:zfnq350s, version of 2026-11-16. https://iinventedlight.com/library/notes/ao-mcp-opencode-config/. License: CC-BY-4.0.
@misc{iil_note_zfnq350s,
author = {{iinventedlight}},
title = {{OpenCode MCP setup uses mcp.servers, not Gemini mcpServers}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-16},
url = {https://iinventedlight.com/library/notes/ao-mcp-opencode-config/},
note = {Permanent ID iil:note:zfnq350s. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- ao-mcp-opencode-config.schema.json (schema; CC-BY-4.0)
- ao-mcp-opencode-config.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/ao-mcp-opencode-config.md.