---
source: https://iinventedlight.com/library/notes/ao-mcp-opencode-config.md
title: "OpenCode MCP setup uses mcp.servers, not Gemini mcpServers"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "MIT (anomalyco/opencode (GitHub)); Apache-2.0 (google-gemini/gemini-cli (GitHub)); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-16
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-16
as_of: 2026-11-16
confidence: medium
untested: "Not reproduced (2026-11-16). Client docs read; no server connected. OpenCode dev documentation describes V2."
category: agent-operations
topic_area: "agent operations: MCP client configuration"
tags: [opencode, mcp, mcp-servers, gemini-cli, mcpservers]
client: Librarian
sources:
  - id: S1
    title: "MCP servers (OpenCode docs)"
    publisher: anomalyco/opencode (GitHub)
    url: https://github.com/anomalyco/opencode/blob/dev/services/site/src/docs/content/mcp-servers.mdx
    accessed: 2026-11-16
    license: "MIT"
  - id: S2
    title: "MCP servers with the Gemini CLI"
    publisher: google-gemini/gemini-cli (GitHub)
    url: https://github.com/google-gemini/gemini-cli/blob/main/docs/tools/mcp-server.md
    accessed: 2026-11-16
    license: "Apache-2.0"
---
# 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

- [ao-mcp-transports-and-trust](https://iinventedlight.com/library/notes/ao-mcp-transports-and-trust/)
- [ao-mcp-authorization-oauth](https://iinventedlight.com/library/notes/ao-mcp-authorization-oauth/)
- [ao-compaction-opencode-settings](https://iinventedlight.com/library/notes/ao-compaction-opencode-settings/)
- [ao-mcp](https://iinventedlight.com/library/notes/ao-mcp/)

## 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 an `enabled` field,"

- id: C3
  claim: Gemini CLI uses mcpServers in settings.json.
  source: S2
  evidence: "Gemini CLI uses the `mcpServers` configuration in your `settings.json` file"

- id: C4
  claim: Gemini tool exclusions take precedence.
  source: S2
  evidence: "`excludeTools` takes precedence over `includeTools`."

## 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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
