Repository navigation
How do I add an MCP server to Gemini CLI (and why won't my remote server connect)? #5
Unanswered
nemesisLLC
asked this question in
Q&A
Replies: 1 comment
|
In Gemini CLI, MCP servers are configured in gemini mcp add my-server npx -y @modelcontextprotocol/server-filesystem /pathIf a remote server won\x27t connect, check:
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Short answer: servers go in
~/.gemini/settings.jsonundermcpServers(a project can have.gemini/settings.json). The command line is easiest:httpUrl, noturlThis is the usual reason a remote server won't connect. In Gemini CLI:
httpUrl= streamable HTTP (what most hosted servers use today)url= the older SSE transport{ "mcpServers": { "playwright": { "command": "npx", "args": ["-y", "@playwright/mcp@latest"] }, "context7": { "httpUrl": "https://mcp.context7.com/mcp", "headers": { "CONTEXT7_API_KEY": "$CONTEXT7_API_KEY" } } } }Put a modern server's address under
urland it fails to connect.Two more gotchas
gemini mcp adddefaults to the project scope. Without--scope user, the server lands in.gemini/settings.jsonin whatever folder you're in, and seems to "disappear" when you change folders.gemini mcp listshows command servers as Disconnected in folders you haven't trusted. Rungemini trustthere, or accept the prompt when you open Gemini in that folder.Full guide: https://calyban.com/blog/mcp-servers-cursor-copilot-gemini-claude-desktop
All reactions