---
title: "Gemini CLI MCP config: file path, key, example · DotsAgent"
description: "Add MCP servers to Gemini CLI from Google: where the config file lives, the top-level key and format, remote OAuth support and a sample config."
url: https://dotsagent.io/mcp/clients/gemini-cli
---

Google

# Add MCP servers to Gemini CLI

Gemini CLI reads mcpServers from settings.json in ~/.gemini/ or in the project's .gemini/ folder.

- **macOS**: `~/.gemini/settings.json`
- **Windows**: `~/.gemini/settings.json`
- **Linux**: `~/.gemini/settings.json`
- **Project file**: `.gemini/settings.json`
- **Top-level key**: `mcpServers`
- **Format**: json
- **OAuth for remote servers**: 

## Example config

This example adds GitHub's hosted server and Playwright as a local server, in the shape this client expects.

`.gemini/settings.json`

```
{
  "mcpServers": {
    "github": {
      "httpUrl": "https://api.githubcopilot.com/mcp/"
    },
    "playwright": {
      "command": "npx",
      "args": [
        "@playwright/mcp@latest"
      ]
    }
  }
}
```

`shell`

```
gemini mcp add -s project -t http github https://api.githubcopilot.com/mcp/
gemini mcp add -s project playwright npx @playwright/mcp@latest
```

## Notes and quirks

- The field name picks the transport: httpUrl for Streamable HTTP, url for SSE, command for stdio.
- gemini mcp add writes to project scope unless you pass -s user.
- includeTools and excludeTools filter which tools the model sees.
- OAuth tokens are saved in ~/.gemini/mcp-oauth-tokens.json.

[Build a Gemini CLI config →](https://dotsagent.io/mcp/config#client=gemini-cli)

## Other clients

[Claude Desktop](https://dotsagent.io/mcp/clients/claude-desktop)

[Claude Code](https://dotsagent.io/mcp/clients/claude-code)

[Cursor](https://dotsagent.io/mcp/clients/cursor)

[VS Code (GitHub Copilot)](https://dotsagent.io/mcp/clients/vscode-copilot)

[Windsurf / Devin Desktop](https://dotsagent.io/mcp/clients/windsurf)

[Zed](https://dotsagent.io/mcp/clients/zed)

[OpenAI Codex CLI](https://dotsagent.io/mcp/clients/codex-cli)

[ChatGPT](https://dotsagent.io/mcp/clients/chatgpt)

[OpenClaw](https://dotsagent.io/mcp/clients/openclaw)

[Cline](https://dotsagent.io/mcp/clients/cline)

[Continue](https://dotsagent.io/mcp/clients/continue)

[JetBrains AI Assistant](https://dotsagent.io/mcp/clients/jetbrains-ai)

## Sources

1. [geminicli.com](https://geminicli.com/docs/tools/mcp-server/)/docs/tools/mcp-server/
2. [raw.githubusercontent.com](https://raw.githubusercontent.com/google-gemini/gemini-cli/main/docs/tools/mcp-server.md)/google-gemini/gemini-cli/main/docs/tools/mcp-server.md

Independent reference for people who build AI agents. Not affiliated with any vendor named here.

© 2026 DotsAgent · Facts checked October 1, 2026
