Add the server
Add a named entry pointing at the remote server URL, then restart the CLI.
{
"mcpServers": {
"mcp-ads": {
"url": "https://mcp-ads.com/mcp-slim"
}
}
}Gemini CLI is developing quickly and its MCP configuration has changed between releases. If this key is not recognised, check the settings format for your installed version.
Troubleshooting
- The server is not listed after a restart: the file is at the wrong path or is not valid JSON. The user-level file is ~/.gemini/settings.json; a project-level .gemini/settings.json also works and is the one people edit by mistake when they meant the other. A trailing comma breaks the whole file silently.
- The OAuth window is blocked: the CLI tries to open the system browser, which fails on a remote machine or when a popup blocker intervenes. Copy the printed URL into any browser and approve there.
- "A server with this URL already exists": the same URL is present in both the user-level and project-level settings, or under two names in one file. Keep one entry and restart.
- The key is not recognised: Gemini CLI's MCP settings have changed between releases. Run gemini --version and check the settings reference for that version; some builds expect httpUrl rather than url for remote servers.