Data coding-agents/
Gemini CLI MCP config: file location, transports and auth
One row of the MCP client config reference, checked 2026-12-06.
- Client
- Gemini CLI
- Vendor
- Config file
- ~/.gemini/settings.json (user); .gemini/settings.json (project); system settings at /etc/gemini-cli/settings.json (Linux), C:\ProgramData\gemini-cli\settings.json (Windows), /Library/Application Support/GeminiCli/settings.json (macOS)
- Format
- JSON, mcpServers object in settings.json; gemini mcp add
- Scopes
- User and project (gemini mcp add --scope, default project); system settings take precedence over both
- Transports
- stdio (command); SSE (url); Streamable HTTP (httpUrl)
- Remote OAuth
- Yes, for SSE and HTTP servers: discovers OAuth endpoints after a 401 and performs DCR if supported; /mcp auth to sign in; default callback http://localhost:<random-port>/oauth/callback (custom redirectUri allowed); tokens in ~/.gemini/mcp-oauth-tokens.json
- Admin controls
- System settings file: same-name servers resolve System > Workspace > User and users cannot override a system server; mcp.allowed and mcp.excluded name lists; per-server includeTools and excludeTools; Google says these are not a foolproof security boundary
- Docs
- https://geminicli.com/docs/tools/mcp-server/
- Source
- https://geminicli.com/docs/cli/enterprise/
From the MCP client config reference, checked Dec 6, 2026. Licence CC BY 4.0.
Gemini CLI reads mcpServers from settings.json, and the field you set picks the transport: command for stdio, url for SSE and httpUrl for Streamable HTTP, per the Gemini CLI MCP docs. gemini mcp add writes to project scope unless you pass --scope user.
For OAuth, the CLI detects a 401, discovers the endpoints and registers a client dynamically when the server supports it. The browser flow fails in headless or remote SSH sessions.
The enterprise guide puts admin config in a system settings.json. A user can’t override a server defined there, and mcp.allowed limits which server names connect. Google says these patterns aren’t a foolproof security boundary. As of December 6, 2026, Gemini CLI’s docs say Antigravity CLI replaced it for unpaid tier and Google One users on June 18, 2026. Antigravity CLI has its own row. More in Gemini CLI MCP config.
Sources
Cite this page
Agents for Devs. "Gemini CLI MCP config: file location, transports and auth." Published Dec 6, 2026. https://agentsfordevs.com/mcp-clients/gemini-cli - Page: https://agentsfordevs.com/mcp-clients/gemini-cli
- Markdown version: https://agentsfordevs.com/mcp-clients/gemini-cli.md
- Reuse: quote or summarize with a link to this page. Reuse terms