# How to add MCP servers to Gemini CLI and Antigravity

Gemini CLI and Antigravity keep MCP servers in JSON files, under the "mcpServers" key: Gemini CLI in ~/.gemini/settings.json (for you) or .gemini/settings.json (for one project) and Antigravity in ~/.gemini/config/mcp_config.json (for you) or .agents/mcp_config.json (for one project). A local server’s entry is a command with args; a remote server’s entry is its URL in httpUrl (Gemini CLI), serverUrl (Antigravity).

Last checked 25 Nov 2026. Page: https://ai-powered.com/clients/gemini

## Quick facts

- Local servers: Yes (stdio)
- Remote servers: Streamable HTTP: Yes · SSE: Partly (URL field: httpUrl (Gemini CLI), serverUrl (Antigravity))
- Sign-in: OAuth: Yes · Headers: Yes (Gemini CLI discovers OAuth and registers itself with dynamic client registration. Antigravity tries a fixed oauth.clientId, then a client ID metadata document, then dynamic registration.)
- Resources: Partly
- Prompts: Partly
- Tool approval: Yes
- Plans: Since 18 June 2026, unpaid tier and Google One users get Antigravity CLI instead of Gemini CLI.
- Platforms: macOS, Windows and Linux

## Gemini CLI and Antigravity config files

| Scope | System | Path |
| --- | --- | --- |
| For you | Gemini CLI, All systems | `~/.gemini/settings.json` |
| For one project | Gemini CLI, All systems | `.gemini/settings.json` |
| For you | Antigravity, All systems | `~/.gemini/config/mcp_config.json` |
| For one project | Antigravity, All systems | `.agents/mcp_config.json` |

## Servers that work in Gemini CLI and Antigravity

- [REA](https://ai-powered.com/mcp/rea): CLI and MCP server that lets coding agents reverse engineer apps and binaries
- [Browser Use](https://ai-powered.com/mcp/browser-use): Browser agents and cloud browsers for AI, with an MCP server for web tasks
- [Scrapling MCP Server](https://ai-powered.com/mcp/scrapling-mcp-server): MCP server for AI clients to scrape sites with HTTP and stealth browser sessions
- [HyperFrames by HeyGen](https://ai-powered.com/mcp/hyperframes-by-heygen): Hosted MCP connector for creating and rendering videos from HTML through AI chat
- [Context7](https://ai-powered.com/mcp/context7): Version-specific library docs and code examples piped into coding agents via MCP
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): MCP server and CLI that let coding agents drive and inspect a live Chrome browser
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Local MCP server that builds a code knowledge graph for AI coding agents
- [GitHub](https://ai-powered.com/mcp/github): Official MCP server connecting AI assistants to GitHub repos, issues and workflows
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): MCP toolkit giving coding agents symbol-level code retrieval and editing
- [ffmpeg-skill](https://ai-powered.com/mcp/ffmpeg-skill): Local FFmpeg video and audio editing tools for coding agents over MCP
- [Ha MCP](https://ai-powered.com/mcp/ha-mcp): MCP server for managing and automating Home Assistant from AI assistants
- [Agent-Native Analytics](https://ai-powered.com/mcp/agent-native-analytics): Open-source analytics app where an AI agent builds charts and dashboards from your data

## Troubleshooting

- A remote server fails in Gemini CLI: Gemini CLI reads httpUrl as Streamable HTTP and url as the older SSE connection. Most current servers need httpUrl.
- A remote server fails in Antigravity: Antigravity reads serverUrl (or url) and only speaks Streamable HTTP. It doesn’t accept httpUrl or SSE-only servers.
- Tool rules for a server don’t apply: Gemini CLI splits tool names on underscores, so a server named my_server can break allow and deny rules. Use a name like my-server.
- A server fails without an error message: Gemini CLI hides background server errors. Run /mcp list or gemini mcp list to see them.
- A tool call times out in Antigravity: Antigravity allows 300 seconds to connect and 180 seconds per tool call. Set timeoutSeconds on the server to change both.
- A local server fails with “npx” (or uvx, docker) not found: Apps started from a dock or menu may not see your terminal’s PATH. Use the full path of the command (run which npx in a terminal to find it), then restart Gemini CLI and Antigravity.
- You can’t tell whether the server or Gemini CLI and Antigravity is at fault: Test the server on its own with the MCP Inspector (npx @modelcontextprotocol/inspector). If it lists tools there, check the Gemini CLI and Antigravity setup.

## Safety

- Gemini CLI asks before running MCP tools. Setting trust: true on a server skips every confirmation, so keep it for servers you wrote or fully trust.
- Antigravity runs unconfigured MCP tools in Ask mode. Allow tools one by one rather than with mcp(*).
- Use $VAR or ${VAR} in Gemini CLI settings for secrets instead of writing tokens into a project file.
- A local server runs on your computer with your access to files and the network. Add only servers whose source you trust.

## Questions

### Where do Gemini CLI MCP servers go?
Under mcpServers in ~/.gemini/settings.json for every project, or .gemini/settings.json in a project.

### Where does Antigravity keep MCP servers?
In ~/.gemini/config/mcp_config.json for all projects, or .agents/mcp_config.json in a workspace.

### Why does the same server need different fields in Gemini CLI and Antigravity?
Gemini CLI uses httpUrl for Streamable HTTP and url for SSE. Antigravity uses serverUrl (or url) and has no SSE. Copy the snippet for the product you use.

### Can I still use Gemini CLI on the free tier?
No. Since 18 June 2026, people on the unpaid tier or a Google One plan use Antigravity CLI instead, so follow the Antigravity snippet.

### How do I add a server to Gemini CLI from the terminal?
Run gemini mcp add with a name and a command or URL. Add -s user to save it for every project and --transport http for a remote server; the default is the current project and stdio.

### Can I use local MCP servers in Gemini CLI and Antigravity?
Yes. Gemini CLI and Antigravity start a local server as a command on your computer (stdio).

### Do Gemini CLI and Antigravity support remote MCP servers?
Yes. Gemini CLI and Antigravity connect over Streamable HTTP. The URL goes in httpUrl (Gemini CLI), serverUrl (Antigravity).

### Can Gemini CLI and Antigravity sign in to MCP servers with OAuth?
Yes. Gemini CLI discovers OAuth and registers itself with dynamic client registration. Antigravity tries a fixed oauth.clientId, then a client ID metadata document, then dynamic registration.

## Sources

- [Gemini CLI docs: MCP servers](https://geminicli.com/docs/tools/mcp-server/)
- [Antigravity docs: MCP](https://antigravity.google/docs/mcp)