For most developers, the best MCP servers for Gemini CLI are GitHub (repos, issues and pull requests), Context7 (current library docs), a browser server like Chrome DevTools or Playwright, and one live web data server such as Olostep or Firecrawl. Start with three or four servers. Each server adds tools, and every tool costs context before you type a prompt.
The shortlist at a glance:
| Server | Job | Transport | Auth | Approx. Tool Footprint |
|---|---|---|---|---|
| GitHub MCP Server | Repos, issues, PRs, Actions | Remote HTTP or extension | Personal access token | Large (96 tools in GitHub's Gemini guide) |
| Context7 | Current library docs | Remote HTTP | API key | Small |
| Chrome DevTools MCP | Debug a live page | Local stdio (npx) | None | Medium (smaller with --slim) |
| Playwright MCP | Scripted browser flows | Local stdio (npx) | None | Medium |
| Olostep MCP Server | Search, scrape, crawl, map, answers | Remote HTTP or local stdio | API key | Medium (10 tools) |
| Firecrawl MCP | Scrape and crawl | Remote HTTP | Keyless or API key | Medium |
| MCP Toolbox for Databases | Query databases | Local | Database credentials | Depends on your config |
| FastMCP (your own) | Internal APIs | Local stdio | You decide | You decide |
The footprint labels are our estimates, except the GitHub and Olostep counts. Run /mcp to see the exact tool list for each server.
What an MCP Server Does Inside Gemini CLI
An MCP server is a small program that gives Gemini CLI new tools. It speaks the Model Context Protocol (MCP), an open standard for connecting AI agents to outside systems. Gemini CLI finds each server's tools at startup and asks you to confirm before it runs one. For a deeper primer, see Model Context Protocol explained.
The ecosystem is large. According to the MCP project announcement from December 2025, MCP had "Over 97 million monthly SDK downloads, 10,000 active servers." Most of those servers are not worth installing for a given project.
Gemini CLI already ships with tools to read and write files, run shell commands, and fetch web pages. That is why this list skips a filesystem server. It would add tools without adding a new capability.
Gemini CLI vs Antigravity CLI in 2026
Gemini CLI changed this year. The official Gemini CLI docs state: "Unpaid tier and Google One users: Gemini CLI was replaced by Antigravity CLI on June 18th, 2026." Google's Antigravity CLI transition post says "Gemini CLI will remain accessible via paid Gemini and Gemini Enterprise Agent Platform API keys." Gemini Code Assist Standard and Enterprise access is unchanged.
The servers below use standard MCP, so they should also connect to other MCP clients, including Antigravity CLI. We tested the config commands in this guide against Gemini CLI's documentation only. Check Antigravity's docs for its exact config format.
How We Picked These Servers
Each server had to meet these criteria:
- Fills a real gap: it does a job Gemini CLI cannot do with its built-in tools.
- Maintained by its owner: it is built by the vendor or an official organization, not an abandoned fork.
- Adoption signal: it has real usage. In the Gemini CLI extensions gallery in October 2026, Context7 showed 62.7k installs, Chrome DevTools 53k and GitHub 32.6k.
- Tool footprint: it exposes a reasonable number of tools, or lets you filter them.
- Documented Gemini CLI setup: the owner documents a config that works in Gemini CLI.
Olostep is our product. We held it to the same criteria and listed an alternative next to it. If you use other MCP clients too, our broader MCP server roundup covers more options.
The 8 Best MCP Servers for Gemini CLI
The servers are grouped by job: code hosting, docs, browser control, live web data, databases and custom tools. Pick one server per job you actually have.
1. GitHub MCP Server
The GitHub MCP Server lets Gemini CLI read repos, open and triage issues, review pull requests and check Actions runs. GitHub maintains it and documents a Gemini CLI install.
The fastest setup is the extension. Set a GITHUB_MCP_PAT environment variable first, then run:
gemini extensions install https://github.com/github/github-mcp-serverYou can also connect to the remote server in settings.json:
"github": {
"httpUrl": "https://api.githubcopilot.com/mcp/",
"headers": { "Authorization": "Bearer $GITHUB_MCP_PAT" }
}The trade-off is size. GitHub's own Gemini CLI install guide shows the server loading 96 tools. Use includeTools to keep only what you need, and use a fine-grained token scoped to the repos the agent should touch.
2. Context7
Context7 pulls current, version-specific library documentation into your prompt. This helps when the model suggests an API that changed after its training data ends. Context7 had the most installs of any MCP extension in the Gemini CLI extensions gallery in October 2026.
Connect to the remote endpoint with your Context7 API key:
"context7": {
"httpUrl": "https://mcp.context7.com/mcp",
"headers": { "Authorization": "Bearer $CONTEXT7_API_KEY" }
}The Context7 README also documents npx ctx7 setup for guided setup. One user-reported issue: Gemini sometimes skips Context7 unless the prompt names it. Adding "use context7" to the prompt usually fixes this.
3. Chrome DevTools MCP
Chrome DevTools MCP gives the agent a live Chrome browser. It can open a page, read console errors, inspect network requests, take screenshots and record performance traces. This is the server to use when you debug a single page.
"chrome-devtools": {
"command": "npx",
"args": ["-y", "chrome-devtools-mcp@latest", "--slim", "--headless"]
}The --slim flag exposes a smaller tool set, and --headless runs Chrome without a window. Per the Chrome DevTools MCP README, the server sends usage statistics to Google by default. Add --no-usage-statistics to turn this off.
4. Playwright MCP
Playwright MCP, from Microsoft, automates Chromium, Firefox and WebKit. It works from accessibility snapshots (a structured text view of the page) instead of screenshots, which suits multi-step flows like logins, forms and end-to-end tests.
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
}Choose Playwright for scripted, repeatable flows across browsers. Choose Chrome DevTools for debugging one page in depth. Most projects need only one of the two.
5. Olostep MCP Server
The Olostep MCP Server gives Gemini CLI live web data. Its tools search the web, scrape a URL into Markdown or JSON, batch-scrape many URLs, map a site's URLs, crawl a site, and return web-grounded answers with sources. Batch and crawl jobs run asynchronously and return an ID you can check later.
Live data matters because models stop learning at a cutoff. The Gemini 3 developer guide states: "Gemini 3 models have a knowledge cutoff of January 2025." Anything newer has to come from a tool.
Olostep's docs show the hosted endpoint for other clients. In Gemini CLI, streamable HTTP servers use the httpUrl key, so the entry looks like this:
"olostep": {
"httpUrl": "https://mcp.olostep.com/mcp",
"headers": { "Authorization": "Bearer $OLOSTEP_API_KEY" }
}To run it locally instead, use npx -y olostep-mcp with OLOSTEP_API_KEY set in env. The free tier includes 500 requests. The Olostep MCP setup docs list every tool and client, and the answers tool runs on the Olostep Answers endpoint.
6. Firecrawl MCP
Firecrawl MCP is another web data server for scraping and crawling, with about 7.5k installs in the Gemini CLI extensions gallery in October 2026. The Firecrawl MCP docs list a keyless start or an API key sent as a bearer token to the same endpoint:
gemini mcp add --transport http firecrawl https://mcp.firecrawl.dev/v2/mcpOlostep and Firecrawl overlap, so install one, not both. Compare output formats, pricing and the specific tools each exposes. Our web search MCP comparison goes deeper on that category.
7. MCP Toolbox for Databases
MCP Toolbox for Databases is Google's open-source server for querying databases such as Postgres and BigQuery. It is listed in the Gemini CLI extensions gallery. Setup depends on your database, so follow the official MCP Toolbox repository for your source.
Start with a development database and read-only credentials. An agent that can run DELETE on production is a risk you do not need.
8. Build Your Own With FastMCP
When no public server fits, you can build one. FastMCP turns Python functions into an MCP server, and one command registers it with Gemini CLI:
fastmcp install gemini-cli server.pyThis works well for internal APIs, such as a deploy tool or a ticket system. Expose only the few functions the agent needs.
How to Add an MCP Server to Gemini CLI
You can add a server with one command or by editing settings.json. Both write to the same config.
Option 1: The gemini mcp add Command
The syntax is:
gemini mcp add [options] <name> <commandOrUrl> [args...]Useful flags include -s user or -s project for scope (project is the default), -t stdio|sse|http for transport, -e KEY=value for environment variables, -H for headers and --include-tools to limit tools. For example, to add Olostep's hosted endpoint for your user account:
gemini mcp add -s user -t http -H "Authorization: Bearer $OLOSTEP_API_KEY" olostep https://mcp.olostep.com/mcpRun gemini mcp list to see your servers and gemini mcp remove <name> to delete one.
Option 2: Edit settings.json
User-level config lives in ~/.gemini/settings.json. Project-level config lives in .gemini/settings.json inside the repo. Each server needs one of command (a local process), url (SSE transport) or httpUrl (streamable HTTP).
{
"mcpServers": {
"github": {
"httpUrl": "https://api.githubcopilot.com/mcp/",
"headers": { "Authorization": "Bearer $GITHUB_MCP_PAT" }
},
"context7": {
"httpUrl": "https://mcp.context7.com/mcp",
"headers": { "Authorization": "Bearer $CONTEXT7_API_KEY" }
},
"chrome-devtools": {
"command": "npx",
"args": ["-y", "chrome-devtools-mcp@latest", "--slim", "--headless"]
},
"olostep": {
"httpUrl": "https://mcp.olostep.com/mcp",
"headers": { "Authorization": "Bearer $OLOSTEP_API_KEY" },
"timeout": 60000
}
}
}Optional keys include env, headers, cwd, timeout (default 600,000 ms, or 10 minutes) and trust (default false). One gotcha: Gemini CLI strips environment variables with names like *TOKEN*, *SECRET* and *KEY* from what local servers inherit. Set each API key explicitly in that server's env block or headers.
Check That It Works With /mcp
Inside a Gemini CLI session, run /mcp. Each server shows as CONNECTED, CONNECTING or DISCONNECTED, with its list of tools.
Gemini CLI names each tool mcp_{serverName}_{toolName}. If the model ignores a server, name it in your prompt, for example "use the olostep tools to search for…".
Keep Your Tool Count and Context Small
Every tool definition is sent to the model before your prompt, and it takes up context. In a five-server example measured on Claude models, Anthropic's tool-use engineering post reported: "That's 58 tools consuming approximately 55K tokens before the conversation even starts." Gemini's numbers will differ, but the overhead works the same way.
There is also a hard ceiling. Users in the Gemini CLI issue tracker hit this API error when many MCP tools were enabled: "At most 512 function declarations can be specified."
These habits keep a setup lean:
- Filter tools: use
includeToolsto allow a list, orexcludeToolsto block one. If a tool appears in both,excludeToolswins. - Use slim modes: flags like Chrome DevTools'
--slimcut the tool set. - One server per job: do not run two browser servers or two web data servers.
- Scope by project: put servers in a repo's
.gemini/settings.jsoninstead of loading everything globally. - Pause servers:
gemini mcp disable <name> --sessionturns a server off for the current session only. - Return clean output: web tools that return Markdown instead of raw HTML use fewer tokens. See LLM-ready web data for why format matters.
This config limits the Olostep server to three of its tools. Run /mcp to see the exact tool names for any server before you filter it.
"olostep": {
"httpUrl": "https://mcp.olostep.com/mcp",
"headers": { "Authorization": "Bearer $OLOSTEP_API_KEY" },
"includeTools": ["search_web", "scrape_website", "get_website_urls"]
}Security Checklist for Gemini CLI MCP Servers
MCP servers run code and handle your tokens, so treat them like any dependency. A 2025 study of 1,899 MCP servers, all open source, found that "7.2% of servers contain general vulnerabilities, and 5.5% exhibit MCP-specific tool poisoning." The tool-poisoning figure came from an early-stage scanner, so treat it as an estimate. Tool poisoning means hiding instructions in a tool's description to steer the agent. The 2025 MCPTox tool-poisoning benchmark tested 2025-era models. Its researchers reported attacks "with an average ASR for all model settings was 36.5%," where ASR is the attack success rate.
Use this checklist:
- Keep confirmations on: leave
trust: falsefor any server that can write, delete or send data. - Scope tokens: use fine-grained, read-only tokens where possible.
- Prefer official servers: install from the vendor or a known organization.
- Treat web content as untrusted: a scraped page can contain prompt injection, so review actions the agent proposes after reading the web.
- Turn off telemetry you don't want: for example, Chrome DevTools MCP's
--no-usage-statistics. - Read tool descriptions: check what a new server's tools say they do before you approve them.
Troubleshooting Common MCP Problems
| Symptom | Likely Cause | Fix |
|---|---|---|
| Server shows DISCONNECTED | Wrong command path or missing key | Run the command by hand in a terminal and check the error |
npx server hangs or starts slowly | npx download on each start, or PATH issues with nvm | Use the full path to npx, install the package globally, or use a hosted endpoint |
| Server says the API key is missing | Gemini CLI strips *KEY* and *TOKEN* variables | Set the key in the server's env block or headers |
| "At most 512 function declarations" error | Too many tools enabled | Filter with includeTools or disable servers |
| OAuth login fails over SSH or in a container | OAuth needs a local browser | Use a header token instead of OAuth |
| Gemini ignores a server's tools | The model didn't pick the tool | Name the server in your prompt |
Starter Stacks by Use Case
Each stack uses four servers or fewer:
- Web app development: GitHub, Context7 and Chrome DevTools.
- QA and end-to-end testing: Playwright and GitHub.
- Research and RAG pipelines: Olostep and Context7.
- Data work: MCP Toolbox for Databases and GitHub.
FAQ
What Are the Best MCP Servers for Gemini CLI?
GitHub, Context7, one browser server (Chrome DevTools or Playwright) and one web data server (Olostep or Firecrawl) cover most development work. Add a database or custom server only when a project needs it.
Are There Free MCP Servers for Gemini CLI?
Many MCP servers are free and open source, though some connect to paid APIs with free tiers, such as Olostep's. Gemini CLI itself now needs a paid Gemini API key or a Gemini Code Assist Standard or Enterprise license.
How Do I Add an MCP Server to Gemini CLI?
Run gemini mcp add <name> <commandOrUrl> or add an entry under mcpServers in ~/.gemini/settings.json. Then run /mcp in a session to confirm the server is CONNECTED.
What Is the Difference Between Gemini CLI Extensions and MCP Servers?
An MCP server is the program that provides tools. An extension is a package, installed with gemini extensions install, that can bundle MCP server config with context files and custom commands.
How Many MCP Servers Can Gemini CLI Use?
The docs set no server limit, but the Gemini API rejects requests with more than 512 function declarations. In practice, three or four servers with filtered tools keep context small.
Do These MCP Servers Work With Antigravity CLI?
These servers use standard MCP, so they should work with other MCP clients, including Antigravity CLI. Check Antigravity's docs for where its config file lives.
How Do I Give Gemini CLI Live Web Access?
Gemini CLI's built-in fetch tool handles single pages. For search, crawling, many URLs or structured output, add a web data MCP server such as Olostep.



