Does gemini-cli support remote MCP servers configured with url in settings.json?
I'm using gemini-cli and want to add a remote MCP server to settings.json with only a url field, but the configuration docs I found only show local servers launched with a command. Does gemini-cli support url-only remote MCP servers, where is that documented, and was the auth-loop issue with remote servers fixed?
Originally asked on GitHub: https://github.com/google-gemini/gemini-cli/issues/983
3 answers
Status: closed as completed. Remote MCP servers with just a
urlalready work in gemini-cli; the reporter was looking at the settings-file doc, but theurlproperty is documented underdocs/tools/mcp-server.md#configuration-properties. A contributor also confirmed that the authentication-loop issue seen with remote servers (issue #2046) was fixed along the way.To configure a remote MCP server, put the
urldirectly undermcpServersinsettings.json:json{ "mcpServers": { "cloud-run": { "url": "https://remote-mcp.com/mcp" } } }If a given gemini-cli version rejects the
urlform, the workaround proposed in the issue is to launch the server throughmcp-remoteinstead:json{ "mcpServers": { "cloud-run": { "command": "npx", "args": ["-y", "mcp-remote", "https://remote-mcp.com/mcp"] } } }No patch was needed for the original issue because the feature already existed. The only real bug mentioned in the thread was the auth loop in issue #2046, which a contributor said was fixed.
General advice: a remote MCP server can access whatever tools the client exposes to it, so only configure URLs you trust.
Did this work for you?What a GitHub user tried on GitHub (Outcome unclear)
The reporter proposed launching a remote server via npx/mcp-remote as a workaround for clients that do not accept a bare url:
"command": "npx", "args": ["-y", "mcp-remote", "https://remote-mcp.com/mcp"]. The thread does not confirm it was tested.Source: https://github.com/google-gemini/gemini-cli/issues/983 (opens external site)
Did this work for you?What @alexaka1 tried on GitHub (Worked)
A commenter pointed out that url-only remote MCP servers do work and are documented in docs/tools/mcp-server.md#configuration-properties.
Source: https://github.com/google-gemini/gemini-cli/issues/983#issuecomment-3008684874 (opens external site)
Did this work for you?
Related questions
- gemini-cli 400: "only 'enum' and 'date-time' are supported for STRING type"
- Gemini CLI: API Error 'Model stream ended with an invalid chunk or missing finish reason' after ReadFile or Edit tool calls
- gemini-cli stuck on "This is taking a bit longer" after Esc cancel — is there a fix?
- Is there a way to get codebase indexing in gemini-cli?
- How can I use voice input instead of typing with Gemini CLI?