Connect Gemini CLI
The Gemini CLI reads MCP servers from `~/.gemini/settings.json`. Use the `httpUrl` field to point it at your streamable HTTP endpoint.
How do I connect an MCP server to Gemini CLI?
Add an `mcpServers` entry whose `httpUrl` field points at your server to `~/.gemini/settings.json`, then restart the CLI and confirm with the `/mcp` command. The `httpUrl` key (not `url`) is what selects the streamable HTTP transport.
Setup
- Open `~/.gemini/settings.json` (create it if it does not exist).
- Add the `mcpServers` block below with your deployment URL.
- Restart the Gemini CLI.
{
"mcpServers": {
"my-server": {
"httpUrl": "https://my-server.mcp.cloud/mcp"
}
}
}Verify the connection
Run `/mcp` inside the Gemini CLI and confirm your server is listed.
Troubleshooting
Server not detected.
Use `httpUrl` (not `url`) for streamable HTTP servers in the Gemini CLI.
Connect another client
Claude Code
Add your MCP server to Claude Code from the terminal.
Claude Desktop
Connect Claude Desktop to a remote MCP server over a stdio bridge.
Cursor
Point Cursor at a remote MCP server.
VS Code
Add a remote MCP server to VS Code.
Windsurf
Connect Windsurf to a remote MCP server.
Antigravity
Add a remote MCP server to Antigravity.
Codex
Add a remote MCP server to the Codex CLI and IDE extension.
ChatGPT
Add your MCP server to ChatGPT as a custom connector.