
How to add an MCP server to Gemini CLI
Add MCP servers to Gemini CLI with gemini mcp add or the mcpServers block in settings.json, for one project or for every project.
- Local servers
- Yes
- runs stdio servers
- Hosted servers
- Yes
- connects by URL
- Config
- JSON
- how servers are added
- Picks
- 7
- ranked
Run gemini mcp add <name> <command> for a local server or gemini mcp add --transport http <name> <url> for a hosted one. Servers are saved to .gemini/settings.json in the project by default, or to ~/.gemini/settings.json with --scope user. Gemini CLI is now offered for Gemini Code Assist Standard and Enterprise licenses; free and Google AI Pro or Ultra accounts moved to Antigravity CLI in June 2026.
Good for
- Teams with Gemini Code Assist Standard or Enterprise who want Gemini to reach GitHub, databases or docs
- Projects that commit shared servers in .gemini/settings.json
- People who need per-server tool allowlists and trust settings
- Anyone whose remote server needs a browser sign-in
Install Gemini CLI
Gemini CLI
- 1
Copy this prompt.
Add the Gemini CLI MCP server to Gemini CLI. Run this command: npm install -g @google/gemini-cli Then check that it loaded and tell me if I need to sign in or restart.
- 2
Paste it into Gemini CLI. It shows the change and asks before running it.
Requires Node.js.
Then run gemini in a project folder. The README says Gemini CLI is designed for Gemini Code Assist Standard / Enterprise licenses and Code Assist for GitHub on Google Cloud, plus legacy paid API or Vertex keys. Free individual access and Google AI Pro / Ultra moved to Antigravity CLI on June 18, 2026. Add servers with gemini mcp add or by editing settings.json, as shown below.
From the vendor's docs. Source.
At a glance
- Add a local server
- gemini mcp add <name> <command> [args...]
- Add a hosted server
- gemini mcp add --transport http <name> <url>
- Transports
- stdio, SSE and streamable HTTP
- User config
- ~/.gemini/settings.json, key mcpServers
- Resources and prompts
- Both; resources via @server://path, prompts become slash commands
- Check servers
- gemini mcp list, or /mcp in the app
- Default timeout
- 600,000 ms (10 minutes) per request
Add an MCP server to Gemini CLI
- 1
Add a local server with gemini mcp add
Put the launch command after the name. Pass keys with
-e.gemini mcp add github npx -y @modelcontextprotocol/server-github gemini mcp add -e API_KEY=123 my-server /path/to/serverThe default scope is the project. Add
--scope userto use the server in every project. - 2
Or add a hosted server by URL
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/Use
--transport ssefor a server that speaks Server-Sent Events. - 3
Or edit settings.json by hand
Open
~/.gemini/settings.json(every project) or.gemini/settings.json(this project). Add anmcpServersobject:{ "mcpServers": { "github": { "command": "docker", "args": ["run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server:latest"], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_PERSONAL_ACCESS_TOKEN}" } }, "remote": { "httpUrl": "https://api.example.com/mcp" } } }commandis stdio,httpUrlis streamable HTTP andurlis SSE. - 4
Limit tools if you want
Add
includeTools(allowlist) orexcludeToolsto a server.excludeToolswins if a tool is in both. Add"trust": trueonly for servers you control, because it skips every confirmation. - 5
Check it loaded
Restart Gemini CLI, then run
gemini mcp listin your shell or/mcpinside the app. A working server showsConnected. Run/mcp reloadafter changing a server. - 6
Sign in if it asks
For a hosted server that needs OAuth, run
/mcp authto list servers that need it, then/mcp auth <server-name>. Your browser opens to finish sign-in. - 7
Switch a server off
Run
gemini mcp disable <name>, or add--sessionto disable it for this session only.gemini mcp remove <name>deletes it.
Best MCP servers for Gemini CLI
Official servers with an approved PlugWiki page whose transport Gemini CLI supports (stdio or HTTP); ordered by GitHub stars, then weekly downloads.
- 1
Context7OfficialHosted or LocalAPI keyGives the assistant current library docs.
64,001 GitHub stars - 2
Playwright MCPOfficialLocalDrives a real browser so the assistant can test what it builds.
38,887 GitHub stars - 3
GitHub MCP ServerOfficialHosted or LocalOAuthPull requests, issues and code search beyond what git can do.
34,115 GitHub stars - 4
Stripe MCPOfficialHosted or LocalOAuthStripe's hosted server for payments, customers and refunds.
2,014 GitHub stars - 5
sentry-mcpOfficialHosted or LocalOAuthPulls Sentry errors into the assistant so it can find the cause.
952 GitHub stars - 6
ZapierOfficialHostedOAuthReaches thousands of apps through the actions you set up in Zapier.
452 GitHub stars - 7
Firecrawl MCP ServerOfficialHosted or LocalAPI keyTurns web pages into clean text, using your Firecrawl key.
190,711/wk downloads a week
MCP servers that work in Gemini CLI
40 · official first, then servers with a page, then by stars
Scrapling MCP ServerOfficialLocalNo sign-inWeb scraping with stealth HTTP, real browsers, and Cloudflare bypass. CSS selectors supported.
90.6K GitHub stars
Context7OfficialHosted or LocalAPI keyUp-to-date docs for AI agents
64K GitHub stars
Chrome DevTools MCPOfficialLocalMCP server for Chrome DevTools
54.5K GitHub stars
Playwright MCPOfficialLocalPlaywright MCP server
38.9K GitHub stars
GitHub MCP ServerOfficialHosted or LocalOAuthGitHub's official MCP server. Lets an AI assistant read code, manage issues and pull requests, check Actions runs and security alerts. Hosted at api.githubcopilot.com/mcp or run locally with Docker or a Go binary.
34.1K GitHub stars
OpenWork MCP GatewayOfficialHostedOAuthYour OpenWork org's skills, plugins, workflows, and connections through one OAuth MCP URL.
24.3K GitHub stars
MCP Toolbox for DatabasesOfficialLocaltoken in envMCP Toolbox for Databases enables your agent to connect to your database.
16.8K GitHub stars
apify-mcp-serverOfficialHosted or LocalOAuthExtract data from any website with thousands of scrapers, crawlers, and automations on Apify Store ⚡
14K GitHub stars
SeleniumBase MCPOfficialLocalNo sign-inStealthy browser automation, testing, and web-scraping via CDP Mode.
13.2K GitHub stars
AutoClipOfficialLocalNo sign-inClip long videos into short clips with covers and captions. Local CLI and MCP.
9.9K GitHub stars
Firecrawl MCP ServerOfficialHosted or LocalAPI keyFirecrawl, the context API for AI agents: search, scrape, interact with the web, plus paper search.
7.7K GitHub stars
firecrawl-mcp-serverOfficialLocalAPI keyOfficial Firecrawl MCP server, the context API for AI agents: search, scrape, and interact with the web, plus parse, crawl, map, Agent and Monitor, from any MCP client.
7.7K GitHub stars
MobileBuildMCPOfficialLocalBuild, run and test iOS and macOS apps, drive the simulator and debug with LLDB from your AI assistant. Formerly XcodeBuildMCP.
6.5K GitHub stars
magic-mcpOfficialLocalAPI keyIt's like v0, but in your Cursor / Claude Code / Windsurf: search 10,000+ React/Tailwind components, generate new UI with AI, and publish your own — right from your editor. Magic MCP is now the 21st MCP; this package keeps old configs working. Setup: 21st.dev/mcp
6.3K GitHub stars- Excalidraw MCPOfficialHosted or LocalNo sign-in
Official Excalidraw MCP App server: streams hand-drawn diagrams into the chat with interactive fullscreen editing. Hosted or local.
5.6K GitHub stars
Exa MCP ServerOfficialHosted or LocalOAuthConnect AI agents to Exa for web search, content fetching, and multi-step research.
5.2K GitHub stars
notion-mcp-serverOfficialLocaltoken in envOfficial Notion MCP Server
4.7K GitHub stars
mcp-grafanaOfficialHosted or LocalAn MCP server giving access to Grafana dashboards, data and more.
3.6K GitHub stars- Google Analytics MCP ServerOfficialLocaltoken in env
Google's official Google Analytics MCP server: runs locally and queries GA4 reports and property settings with your Google credentials. Read-only unless you add the --allow-write flag.
3.6K GitHub stars
SupabaseOfficialHosted or LocalOAuthMCP server for interacting with the Supabase platform
3K GitHub stars
Show all 40Show fewer
brightdata-mcpOfficialLocaltoken in envA powerful Model Context Protocol (MCP) server that provides an all-in-one solution for public web access.
2.7K GitHub stars
Perplexity MCP ServerOfficialHosted or LocalOAuthConnector for Perplexity API, to enable real-time, web-wide research.
2.6K GitHub stars
tavily-mcpOfficialLocalProduction ready MCP server with real-time search, extract, map & crawl.
2.5K GitHub stars
Solana MCP by VybeOfficialHostedOAuthSolana MCP developer toolkit: wallets, trades, markets, PnL, transfers, onchain, swaps & API tools.
2.2K GitHub stars
Azure DevOps (ADO)OfficialHostedOAuthThe MCP server for Azure DevOps, bringing the power of Azure DevOps directly to your agents.
2.1K GitHub stars
Azure DevOps Local MCP ServerOfficialLocalOAuthThe MCP server for Azure DevOps, bringing the power of Azure DevOps directly to your agents.
2.1K GitHub stars
anysearch-mcp-serverOfficialHostedAPI keyUnified real-time search MCP server supporting general web search, vertical domain search, parallel batch search, and full-page URL content extraction.
2.1K GitHub stars
Microsoft Learn MCPOfficialHostedNo sign-inOfficial Microsoft Learn MCP Server – real-time, trusted docs & code samples for AI and LLMs.
2K GitHub stars- WordPress MCP AdapterOfficialLocal
The official WordPress plugin that turns a self-hosted site into an MCP server, exposing Abilities API actions from core, plugins and themes over STDIO (WP-CLI) or HTTP.
1.9K GitHub stars
MeiGen-AI-Design-MCPOfficialHosted or LocalOAuthDiscover inspiration and create images and videos with the latest AI models. Works with ChatGPT, Claude, Cursor, and other MCP clients.
1.8K GitHub stars
MATLAB MCP ServerOfficialLocalNo sign-inConnect AI coding agents to MATLAB. Run code, tests, and analysis via MCP.
1.7K GitHub stars
datagouv-mcpOfficialHostedNo sign-inOfficial data.gouv.fr Model Context Protocol (MCP) server that allows AI chatbots to search, explore, and analyze datasets from the French national Open Data platform, directly through conversation.
1.6K GitHub stars
MiniMax-MCPOfficialLocalAPI keyOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
1.6K GitHub stars
mcp-server-qdrantOfficialLocalAPI keyAn official Qdrant Model Context Protocol (MCP) server implementation
1.6K GitHub stars
TerraformOfficialHosted or LocalAPI keyGenerate more accurate Terraform and automate workflows for HCP Terraform and Terraform Enterprise
1.6K GitHub stars
@brave/brave-search-mcp-serverOfficialLocalBrave Search MCP Server: web results, images, videos, rich results, AI summaries, and more.
1.5K GitHub stars
IDA MCPOfficialLocalNo sign-inOfficial Hex-Rays MCP server that lets AI agents open, decompile and annotate binaries in IDA, alongside you in the IDA GUI or headless.
1.5K GitHub stars- X MCP (X API)OfficialHosted or LocalOAuth
X's hosted MCP server for the X API at api.x.com/mcp: AI clients search posts, read users, trends and news, manage bookmarks and publish Articles through your X developer app, directly or via the xurl mcp bridge.
1.4K GitHub stars
Power BI Authoring MCP Server (Local)OfficialLocalOAuthThe Power BI Authoring MCP server lets an AI agent create and change Power BI semantic models.
1.3K GitHub stars
ref-tools-mcpOfficialLocalAPI keyToken efficient search for coding agents over public and private documentation.
1.2K GitHub stars
Common errors and fixes
Local server shows Disconnected in gemini mcp list
Cause: The folder is not trusted, and stdio servers are only tested in trusted folders.
Fix: Run gemini trust in the folder, then run gemini mcp list again.
gemini-cli Source
Server shows DISCONNECTED in /mcp
Cause: The command, args or cwd are wrong, or the server needs a dependency.
Fix: Run the server command by hand to see its error, then fix command, args and cwd.
gemini-cli Source
Server connects but no tools appear
Cause: The server registers no tools, or its tool list is invalid.
Fix: Check the server logs, then run /mcp reload.
gemini-cli Source
OAuth sign-in never completes
Cause: Sign-in needs a local browser and a redirect to localhost; headless, SSH and container setups have neither.
Fix: Run /mcp auth on a machine with a browser, or use a header token with --header instead.
gemini-cli Source
OAuth fails with HTTP 400 Missing issuer parameter in response
Cause: You set issuer explicitly and the server does not return iss in its redirect.
Fix: Add "authorizationResponseIssParameterSupported": false to the oauth block.
gemini-cli Source
OAuth fails with HTTP 400 Issuer mismatch
Cause: The iss value in the redirect does not match the expected issuer.
Fix: Fix the issuer in the oauth block, or check the server points to the right authorization server.
gemini-cli Source
Server needs a secret but gets none
Cause: Gemini CLI strips variables like *TOKEN* and *KEY* from the inherited environment.
Fix: Set the variable in the server env block, for example "$MY_TOKEN".
gemini-cli Source
Policy rules for a server do nothing
Cause: The server name contains an underscore, so the policy parser misreads the name.
Fix: Rename the server with a hyphen, for example my-server.
gemini-cli Source
Verdict
Gemini CLI covers stdio, SSE and HTTP servers with browser OAuth, per-server tool filters and a gemini mcp command. The main limit is access: it is designed for Gemini Code Assist Standard / Enterprise, and free and Google AI Pro / Ultra access moved to Antigravity CLI on June 18, 2026.
Gemini CLI covers stdio, SSE and HTTP servers with browser OAuth, per-server tool filters and a gemini mcp command. The main limit is access: it is designed for Gemini Code Assist Standard / Enterprise, and free and Google AI Pro / Ultra access moved to Antigravity CLI on June 18, 2026.
Best for
- Teams on Gemini Code Assist Standard or Enterprise
- Projects that share servers through .gemini/settings.json
Skip it if
- You are on a free or Google AI Pro or Ultra account
- You need OAuth on a machine with no browser
Questions
How do I add an MCP server to Gemini CLI?
Run gemini mcp add <name> <command> for a local server, or gemini mcp add --transport http <name> <url> for a hosted one. Check it with gemini mcp list.
Where is the Gemini CLI MCP config file?
~/.gemini/settings.json for every project, under the mcpServers key. A project can also have .gemini/settings.json.
Does Gemini CLI support remote or HTTP MCP servers?
Yes. Use httpUrl for streamable HTTP and url for SSE, or gemini mcp add --transport http <name> <url>.
Does Gemini CLI support OAuth for MCP servers?
Yes, for SSE and HTTP servers. Run /mcp auth <server-name> and finish sign-in in your browser. It does not work on a machine with no browser, such as a headless server or a plain SSH session.
Project or global MCP servers in Gemini CLI?
gemini mcp add saves to the project by default. Add --scope user to save to ~/.gemini/settings.json so every project gets it.
How do I disable an MCP server in Gemini CLI?
Run gemini mcp disable <name>, or /mcp disable <name> in the app. Add --session to disable it only for this session.
Is there a limit on MCP tools in Gemini CLI?
The docs state no tool limit. You can trim a server with includeTools or excludeTools, and every tool gets a name like mcp_<server>_<tool>.
Does Gemini CLI MCP work on Windows and Linux?
Yes. The config file is in your home folder on every system, and env values accept $VAR everywhere and %VAR% on Windows.
Is Gemini CLI free to use with MCP servers?
Not for individuals any more. The README says free individual access and Google AI Pro / Ultra moved to Antigravity CLI on June 18, 2026. Gemini CLI is designed for Gemini Code Assist Standard / Enterprise licenses and Code Assist for GitHub, plus legacy paid API or Vertex keys.
Why does my stdio server show Disconnected in Gemini CLI?
In a folder you have not trusted, stdio servers show as Disconnected. Run gemini trust in that folder, then list the servers again.
Information
updated Nov 2, 2026
- Transports
- stdio, SSE, Streamable HTTP
- Config file (all)
~/.gemini/settings.json- MCP docs
- geminicli.com
Sources
Docs, issue trackers and discussions this page is built from.
Show all 5Hide
- Gemini CLI README · github.com
- MCP servers with Gemini CLI · github.com
- Gemini CLI cheatsheet · github.com
- Gemini CLI configuration · github.com
- Set up an MCP server · github.com