Gemini CLI's MCP server isn't working
Where Gemini CLI keeps its MCP servers, why a remote one needs httpUrl, how /mcp shows and signs in to them, and where to read what went wrong.
Gemini CLI keeps MCP servers in its settings file, shows them with /mcp, and signs in to a remote one from there. From Gemini CLI's own docs, read on 17 October 2026.
Where the file is
.gemini/settings.jsonin the folder you work in, for that folder.gemini mcp addwrites here.~/.gemini/settings.jsonin your home folder, for every folder (gemini mcp add -s user).
Both put servers under mcpServers. A remote server like Hamloy goes in httpUrl:
{ "mcpServers": { "hamloy": { "httpUrl": "https://hamloy.com/mcp" } } }
In Gemini CLI, url means the older SSE transport, and httpUrl the newer one Hamloy uses. Putting the address in url is a common reason a server shows as disconnected.
See whether it is connected
Type /mcp in Gemini CLI: each server is CONNECTED, CONNECTING or DISCONNECTED, with its tools. From your shell, gemini mcp list gives each server's name, entry and state.
Sign in again
/mcp auth lists the servers that need a sign-in; /mcp auth hamloy opens your browser on Hamloy's. Run it again whenever it asks. The sign-in comes back to your own computer, so it doesn't work over SSH or in a container: use an API token there, as Gemini CLI's page shows.
Read what happened
Gemini CLI keeps a server's connection errors quiet. Start it with --debug to see them, or press F12 for its debug console.
Its own quirks
- A server's name should have no underscore in it.
- A tool's name is cut at 63 characters.
The errors, one by one
- The wrong type for the app
- No sign-in window opens
- The token variable isn't read
- The server is added, but there are no tools
Check that it worked
Ask "What's open in Hamloy?" The agent calls the list tool and you get your lists back:
Pebble · 4 open, 1 done
backlog
## Streaks
[ ] B-k3f9@2 Streak counter on the habit card (claimed by claude on streak-counter in pebble)
[ ] B-m2xq@1 Share a streak as an image
requests
[ ] R-q4ve@1 Create an Apple developer account
Setting it up from the start: Gemini CLI.