Google Search Console, Bing and GA4 in Gemini CLI

Gemini CLI connects to remote MCP servers over Streamable HTTP and handles OAuth by itself: it discovers the sign-in, registers as a client and opens your browser. Add GSC Magic once and the agent can check rankings, index status and sitemaps from the terminal.

Last updated: 2026-10-30

In short

Run gemini mcp add --transport http --scope user gsc-magic https://mcp.gscmagic.com/mcp, sign in on the GSC Magic page that opens in your browser, and Gemini CLI can query your Search Console, Bing and GA4 data in any session.

Set up in 4 steps

  1. Create a GSC Magic account, connect Google and import your sites.
  2. Run the command below. It adds GSC Magic to ~/.gemini/settings.json, so it is available in every project.
  3. Start gemini. On first connect it opens the GSC Magic sign-in in your browser; allow access. If it does not, type /mcp auth gsc-magic.
  4. Type /mcp to check that gsc-magic is CONNECTED, then ask: "List my Search Console properties."
Add the server (user scope)
gemini mcp add --transport http --scope user gsc-magic https://mcp.gscmagic.com/mcp

Good to know

  • Do not use an underscore in the server name: Gemini CLI names tools mcp_<server>_<tool>, and its policy rules split on the first underscore. gsc-magic is safe.
  • Sign-in uses OAuth: the client opens a GSC Magic page where you sign in and approve once. No API key or token to paste.
  • On Free your agent can only read. On Pro and Agency write tools are available, and the owner can switch write mode off in Settings in one click.

What to ask once connected

  • "List my Search Console properties and the one with the most clicks last 28 days."
  • "Which queries sit in positions 4–10 with the most impressions? Suggest title changes."
  • "Compare clicks this month with last month by page and tell me what moved."
  • "Which URLs in my sitemap are not indexed, and what does the inspection say?"
  • "How many sessions came from ChatGPT, Perplexity and Claude last month, and to which pages?"

More in 25 SEO prompts for AI agents; the full tool list is on the tools page.

Troubleshooting

The browser never opens (SSH session, container, headless server).

Gemini CLI's OAuth needs a local browser and a callback on localhost. Create an access token in the dashboard (Connect → Access tokens) and add the server with a header instead: gemini mcp add --transport http --scope user -H "Authorization: Bearer gsm_…" gsc-magic https://mcp.gscmagic.com/mcp.

/mcp shows gsc-magic as DISCONNECTED.

Run /mcp auth gsc-magic to sign in again. If you added a token, it may have expired or been revoked; create a new one and replace the header.

The server was added but only works in one folder.

gemini mcp add defaults to project scope (.gemini/settings.json). Remove it and add it again with --scope user.

Questions about Gemini CLI

Where does Gemini CLI keep the sign-in?

In ~/.gemini/mcp-oauth-tokens.json on your computer. It refreshes the token automatically; /mcp auth gsc-magic signs in again if needed.

Does it need a Google Cloud project?

No. GSC Magic holds the Google connection, so Gemini CLI only needs the URL and your GSC Magic sign-in.

Other clients

Claude · ChatGPT · Claude Code · Cursor · Windsurf · VS Code · Any MCP client · Zed · Cline · Continue · n8n · LibreChat · goose · Warp · Raycast · OpenClaw · Hermes Agent · Grok