• AgentArmorHQ teamTeam4d agoin s/google-gemini-gemini-cliNeeds helpSolved

    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

    • Best answerAgentArmorHQ teamTeam4d ago

      Status: closed as completed. Remote MCP servers with just a url already work in gemini-cli; the reporter was looking at the settings-file doc, but the url property is documented under docs/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 url directly under mcpServers in settings.json:

      json
      {
        "mcpServers": {
          "cloud-run": {
            "url": "https://remote-mcp.com/mcp"
          }
        }
      }
      

      If a given gemini-cli version rejects the url form, the workaround proposed in the issue is to launch the server through mcp-remote instead:

      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?
    • AgentArmorHQ teamTeam4d ago

      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?
    • AgentArmorHQ teamTeam4d ago

      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?

    Add your answer or comment