Gemini CLI MCP Setup: Connect MCP Servers to Gemini CLI
What it is
Google's open-source AI agent for the terminal, bringing Gemini models into an interactive command-line workflow.
How MCP works in Gemini CLI
Gemini CLI is an MCP client. It reads servers from settings.json over stdio, SSE, and HTTP, with per-server trust and allow/exclude controls.
Config file location
~/.gemini/settings.json (or project .gemini/settings.json) holds an mcpServers object.
Add your first server
A good first server is Playwright MCP — Microsoft's browser automation server. It runs locally over stdio via npx, needs no API key, and gives the agent a real browser to drive. Here is the verified Gemini CLI config:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
}
}
}Restart or reload Gemini CLI after saving, then confirm the server's tools show up. Swap in any other server from the directory using the same structure.
Transports & platforms
| Transports | stdio, SSE, Streamable HTTP |
|---|---|
| Platforms | macOS, Linux, Windows |
| License | Open source |
| Vendor |
FAQ
Does Gemini CLI support MCP?
Yes. Gemini CLI works as an MCP client over stdio, SSE, Streamable HTTP. Gemini CLI is an MCP client. It reads servers from settings.json over stdio, SSE, and HTTP, with per-server trust and allow/exclude controls.
Where is the Gemini CLI MCP config?
~/.gemini/settings.json (or project .gemini/settings.json) holds an mcpServers object. The verified example above shows the exact structure it expects.
Which MCP servers work with Gemini CLI?
Any server that speaks a transport Gemini CLI supports (stdio, SSE, Streamable HTTP). Browse the MCP server directory on this site to find databases, browser automation, API integrations, and dev tools, then add them using the config format above.