Serverdex · client guide
MCP servers for Gemini CLI
What Gemini CLI supports
from the docs, 21 November 2026Transports: stdio (command), SSE (url) and Streamable HTTP (httpUrl).. Remote servers and auth: Yes — url (SSE) or httpUrl (Streamable HTTP) + headers; OAuth 2.0 with automatic discovery and dynamic client registration, Google ADC (google_credentials) or service-account impersonation.. Full matrix with every client on /mcp-clients.
Where the configuration lives
- Servers are defined in the top-level "mcpServers" object of settings.json; the "mcp" object holds global rules (mcp.allowed, mcp.excluded, mcp.serverCommand).
- User scope: ~/.gemini/settings.json; project scope: .gemini/settings.json — `gemini mcp add -s user|project` picks the file (default: project).
- Enable/disable state is stored in ~/.gemini/mcp-server-enablement.json; OAuth tokens in ~/.gemini/mcp-oauth-tokens.json.
- In a session, /mcp shows configured servers, connection status (CONNECTED / CONNECTING / DISCONNECTED), tools, prompts and resources; /mcp auth, /mcp list, /mcp enable <name>, /mcp disable <name>.
- From the shell: `gemini mcp add`, `gemini mcp list`, `gemini mcp remove <name>`, `gemini mcp enable|disable <name> [--session]`.
Add a server to Gemini CLI
Local server (stdio) — settings.json, with environment-variable expansion
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@github/github-mcp-server"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "$GITHUB_PERSONAL_ACCESS_TOKEN"
}
}
}
}Remote server (Streamable HTTP) with custom headers — settings.json
{
"mcpServers": {
"httpServerWithAuth": {
"httpUrl": "http://localhost:3000/mcp",
"headers": {
"Authorization": "Bearer your-api-token",
"X-Custom-Header": "custom-value",
"Content-Type": "application/json"
},
"timeout": 5000
}
}
}CLI — gemini mcp add (stdio, HTTP, SSE)
gemini mcp add [options] <name> <commandOrUrl> [args...]
gemini mcp add -e API_KEY=123 -e DEBUG=true my-stdio-server /path/to/server arg1 arg2 arg3
gemini mcp add --transport http http-server https://api.example.com/mcp/
gemini mcp add --transport http --header "Authorization: Bearer abc123" secure-http https://api.example.com/mcp/
gemini mcp add --transport sse sse-server https://api.example.com/sse/
gemini mcp listFor a specific server, open its Serverdex page: the “Connect this server” block has the config with the real package name, arguments and environment variables from the registry. Any server, any client: MCP config generator.
Hosted (remote) servers in Gemini CLI
- Streamable HTTP: `gemini mcp add --transport http <name> <url>` (add -H "Authorization: Bearer ..." for a header), or set "httpUrl" in settings.json.
- SSE: `gemini mcp add --transport sse <name> <url>`, or set "url" in settings.json — note that "url" means SSE in Gemini CLI, not Streamable HTTP.
- Pick the file with -s user (~/.gemini/settings.json) or -s project (.gemini/settings.json, default); --timeout, --trust, --include-tools and --exclude-tools are also available.
- OAuth: servers that support discovery need no oauth block — the CLI detects the 401, discovers endpoints, registers dynamically, opens the browser and stores tokens in ~/.gemini/mcp-oauth-tokens.json; use /mcp auth <serverName> to authenticate or re-authenticate.
- Google-hosted servers: set "authProviderType": "google_credentials" with "oauth": {"scopes": [...]}, or "service_account_impersonation" with targetAudience and targetServiceAccount.
- Run `gemini mcp list` (or /mcp list in a session) to confirm the server shows as Connected.
Hosted servers that answered the Serverdex live check with no credentials at the last pass (most-starred first; full list with check times):
Browser Use
browser-use
Browser agents and stealth cloud browsers for AI: run web tasks, fill forms, extract data.
Labelhead Artist Momentum
paperclipai
Trending hip-hop artist momentum scores across four cultural dimensions.
Front-End Checklist
thedaviddias
Review frontend code and live pages against 386 quality-gated web development rules.
Context7
upstash
Up-to-date docs for AI agents
Tldraw
tldraw
Draw and visually collaborate with your agents on tldraw's canvas.
Oh My Posh Validator
JanDeDobbeleer
Validate oh-my-posh configurations and segment snippets against the official schema.
Compiler Explorer
compiler-explorer
Compile code with thousands of compilers, inspect the assembly, and share godbolt.org links
GitDiagram
ahmedkhaleel2004
Architecture diagrams, explanations and Mermaid source for public GitHub repositories.
Spree Commerce developer docs for AI agents
spree
Spree Commerce docs for AI coding agents: build headless B2B and marketplace ecommerce on its APIs.
AIHOT
KKKKhazix
Chinese AI news: search topics, explore hot events, and read daily, weekly and monthly briefs.
Finance Database
JerBouma
Equities, ETFs, indices, currencies and cryptos, categorised.
Firecrawl MCP Server
firecrawl
Firecrawl, the context API for AI agents: search, scrape, interact with the web, plus paper search.
Find servers for Gemini CLI by job or by product
Every server page carries the config in the Gemini CLI shape, the repository's last push and licence, and the live-check result.
Best MCP servers by categoryMCP servers by productComparisonsRemote servers answering now
What the docs say to watch for
- Gotcha: "url" selects the SSE transport and "httpUrl" the Streamable HTTP transport — a Claude-style {"url": ...} entry pointing at a Streamable HTTP endpoint must be renamed to "httpUrl".
- timeout is in milliseconds (default 600,000 ms = 10 minutes). "trust": true bypasses all tool-call confirmation dialogs — use only for servers you completely control.
- Environment sanitization: the CLI redacts host variables matching *TOKEN*, *SECRET*, *PASSWORD*, *KEY*, *AUTH*, *CREDENTIAL* (and GEMINI_API_KEY, GOOGLE_API_KEY) from spawned servers; variables you list explicitly in "env" are passed through. Values expand with $VAR / ${VAR} (all platforms) or %VAR% (Windows); undefined variables resolve to an empty string.
- Stdio servers are only tested and shown as "Connected" if the current folder is trusted; in an untrusted folder they show "Disconnected" — run `gemini trust`.
- Do not use underscores in server names (use my-server, not my_server): the policy parser splits mcp_<server>_<tool> on the first underscore after mcp_, so wildcard and security policies can fail silently.
- includeTools is an allowlist, excludeTools a denylist; excludeTools takes precedence. Tool names are sanitized for the Gemini API (characters outside letters, numbers, _ - . : become _; names over 63 characters are truncated) and every tool gets the fully qualified name mcp_{serverName}_{toolName}.
- Resources are referenced in chat with @server://resource/path (the CLI calls resources/read); MCP prompts become slash commands (/prompt-name --arg=value or positional). Server instructions are appended to the system instructions.
- OAuth requires a local browser and a redirect to http://localhost:<random-port>/oauth/callback — it will not work headless, over SSH without X11 forwarding, or in containers without browser support. Callbacks are validated per RFC 9207: errors are HTTP 400 "Missing issuer parameter in response" or "Issuer mismatch".
- Startup connection errors are silent by default; the hint "MCP issues detected. Run /mcp list for status." appears, and `gemini mcp list` shows the per-server error.
- Status (README, 21 Nov 2026): Gemini CLI is for Gemini Code Assist Standard/Enterprise licenses; it is not optimized for Gemini 4+ models. Free and Google AI Pro/Ultra users were moved to Antigravity CLI on 18 June 2026.
Server not showing up or stuck on loading tools? The troubleshooting guide goes through the causes in order.
Gemini CLI and MCP: questions people ask
- Where is the Gemini CLI MCP config file?
- Servers are defined in the top-level "mcpServers" object of settings.json; the "mcp" object holds global rules (mcp.allowed, mcp.excluded, mcp.serverCommand). User scope: ~/.gemini/settings.json; project scope: .gemini/settings.json — `gemini mcp add -s user|project` picks the file (default: project). Enable/disable state is stored in ~/.gemini/mcp-server-enablement.json; OAuth tokens in ~/.gemini/mcp-oauth-tokens.json. In a session, /mcp shows configured servers, connection status (CONNECTED / CONNECTING / DISCONNECTED), tools, prompts and resources; /mcp auth, /mcp list, /mcp enable <name>, /mcp disable <name>. From the shell: `gemini mcp add`, `gemini mcp list`, `gemini mcp remove <name>`, `gemini mcp enable|disable <name> [--session]`.
- Does Gemini CLI support remote (hosted) MCP servers?
- Yes. Streamable HTTP: `gemini mcp add --transport http <name> <url>` (add -H "Authorization: Bearer ..." for a header), or set "httpUrl" in settings.json. SSE: `gemini mcp add --transport sse <name> <url>`, or set "url" in settings.json — note that "url" means SSE in Gemini CLI, not Streamable HTTP. Pick the file with -s user (~/.gemini/settings.json) or -s project (.gemini/settings.json, default); --timeout, --trust, --include-tools and --exclude-tools are also available. OAuth: servers that support discovery need no oauth block — the CLI detects the 401, discovers endpoints, registers dynamically, opens the browser and stores tokens in ~/.gemini/mcp-oauth-tokens.json; use /mcp auth <serverName> to authenticate or re-authenticate. Google-hosted servers: set "authProviderType": "google_credentials" with "oauth": {"scopes": [...]}, or "service_account_impersonation" with targetAudience and targetServiceAccount. Run `gemini mcp list` (or /mcp list in a session) to confirm the server shows as Connected. Transports per its docs: stdio (command), SSE (url) and Streamable HTTP (httpUrl).; remote and auth: Yes — url (SSE) or httpUrl (Streamable HTTP) + headers; OAuth 2.0 with automatic discovery and dynamic client registration, Google ADC (google_credentials) or service-account impersonation..
- Which MCP features does Gemini CLI support?
- Per its own documentation (read https://geminicli.com/docs/tools/mcp-server/): tools documented, resources documented, prompts documented, elicitation not stated, roots not stated, sampling not stated. "Not stated" means the docs are silent, not that the feature is missing.
- Which MCP servers should I add to Gemini CLI first?
- Pick by the job you need done: the Serverdex guides rank servers by GitHub stars within each category, with last push, licence and live check for each, and the product pages list every server for a given tool (Postgres, Notion, Slack, GitHub…). The hosted servers on this page answered our credential-free MCP handshake at the last check. Then copy the config from the server's page in the Gemini CLI shape.
Sources
- MCP servers with Gemini CLI | Gemini CLI — read 21 November 2026
- docs/tools/mcp-server.md — google-gemini/gemini-cli (main) — read 21 November 2026
- README — google-gemini/gemini-cli (main) — read 21 November 2026
Other clients: Claude Desktop · Claude Code · Cursor · VS Code · Cline · Windsurf · Zed · JetBrains AI Assistant · Continue · OpenAI Codex CLI · Antigravity · OpenCode · Hermes Agent · LM Studio.