Guides › Gemini CLI

How to add MCP servers to Gemini CLI (settings.json)

Gemini CLI reads MCP servers from the mcpServers object in its settings.json. The gemini mcp add command writes it for you.

Checked against the official docs on 2026-11-26. Apps change often; the sources are linked at the bottom.

Where the config file lives

Your servers, all projects~/.gemini/settings.json
One project.gemini/settings.json
Top-level keymcpServers

Add a remote server (a URL)

  1. Add a Streamable HTTP server
    Use --transport http. Note that gemini mcp add saves to the project file unless you pass --scope user.
    gemini mcp add --transport http --scope user linear https://mcp.linear.app/mcp
  2. In settings.json, use httpUrl for HTTP servers
    In Gemini CLI, url means an SSE endpoint and httpUrl means Streamable HTTP (why this matters).
    {
      "mcpServers": {
        "linear": { "httpUrl": "https://mcp.linear.app/mcp" }
      }
    }
  3. Sign in
    Run /mcp auth to see servers that need sign-in, then /mcp auth NAME.
    /mcp auth linear

Add a local server (runs on your computer)

  1. Add a command (stdio) server
    The default transport is stdio. Pass environment variables with -e.
    gemini mcp add --scope user -e API_KEY=123 my-server npx -y @example/mcp-server
  2. Or edit settings.json
    timeout is in milliseconds (default 600,000). trust: true skips every tool confirmation, so leave it off unless you fully trust the server.
    {
      "mcpServers": {
        "context7": {
          "command": "npx",
          "args": ["-y", "@upstash/context7-mcp"],
          "timeout": 30000,
          "trust": false
        }
      }
    }

Check and manage servers

gemini mcp list
# inside Gemini CLI: /mcp

Tips

  • OAuth tokens are stored in ~/.gemini/mcp-oauth-tokens.json.
  • Gemini CLI's site notes that for unpaid-tier and Google One users, Gemini CLI was replaced by Antigravity CLI on June 18, 2026. Antigravity keeps MCP servers in its own mcp_config.json, so this guide applies only if you still use Gemini CLI.

Common problems in Gemini CLI

Sources

Weekly MCP digest
New servers, breaking changes, and fresh fixes. One email a week.