# Gemini CLI for SEO: Analyze Google Search Console from Your Terminal

> Source: <https://gscmagic.com/blog/gemini-cli-seo-search-console>
> Published: 2026-11-28 00:00:00+00:00

**Recommendation:** Register Search Console as a remote HTTP MCP server scoped to the user, verify the agent lists real properties before trusting output, and require explicit approval on every file write so git shows exactly what changed.
More in the playbook "Designing agent systems": <https://wpnews.pro/playbooks/agent-architecture>

# Gemini CLI for SEO: Analyze Google Search Console from Your Terminal

Connect Gemini CLI to Google Search Console via MCP, check that it reads real data, then run index, quick-win and Core Web Vitals checks from your site repo.

Gemini CLI can analyze your Google Search Console data once you connect a remote MCP server. Run `gemini mcp add --transport http --scope user gsc-magic https://mcp.gscmagic.com/mcp` (or install the GSC Magic extension), sign in through `/mcp`, and ask it to list your properties. From there it can check sitemaps against the index, find quick wins and read Core Web Vitals, then edit titles and links in the repo you launched it from, with your approval on every write.

## Why run SEO checks from Gemini CLI at all?

Because the fix usually lives in the same folder. If you already work in the site repo, a terminal agent that can read Search Console and also open `src/pages/pricing.astro` saves you the copy-paste between a dashboard, a spreadsheet and your editor.

My rule for this setup: the agent pulls evidence from your own data, you decide what changes, and git shows you exactly what it touched. Gemini CLI fits that split well. It talks to remote MCP servers over HTTP, handles the OAuth sign-in itself, and asks before it writes a file.

One honest note before the setup. The Gemini app at gemini.google.com has custom MCP connectors for a limited group of users, but GSC Magic does not support connecting from the Gemini app yet, so this guide covers Gemini CLI only.

## What do you need before you connect Gemini CLI?

You need a working Gemini CLI install, a GSC Magic account with at least one imported Search Console property, and a machine that can open a browser for the sign-in. Without the imported property the agent will connect and then report that it sees no sites.

1. **Gemini CLI access.** Google announced in May 2026 that Gemini CLI is[transitioning to Antigravity CLI](https://developers.googleblog.com/an-important-update-transitioning-gemini-cli-to-antigravity-cli/) . From June 18, 2026 it stopped serving Google AI Pro, Ultra and free individual users. It stays available with paid Gemini API keys and with Gemini Code Assist Standard or Enterprise licenses. If you sign in with a personal Google account, check that notice first.
2. **A GSC Magic account.**[Create one free](https://app.gscmagic.com/login?mode=signup) , connect Google and import the property you want to analyze. The Free plan covers 1 site with 200 tool calls a month and 10 a day. Pro is $19 a month for 10 sites and no call limit, and new accounts get a 7-day Pro trial. Details are on the[pricing page](https://gscmagic.com/pricing) .
3. **A local browser.** Gemini CLI’s OAuth flow opens a browser and waits for a redirect on localhost, so it does not work over plain SSH or inside a headless container. There is a token fallback for that case below.

## How do you add GSC Magic to Gemini CLI?

Pick one of two routes: a single `gemini mcp add` command, or the GSC Magic extension, which adds the same server plus a context file with tool guidance. Both end with a sign-in inside Gemini CLI.

**Route 1: the command.** Run this once:

```
gemini mcp add --transport http --scope user gsc-magic https://mcp.gscmagic.com/mcp
```

`--scope user` writes the server to `~/.gemini/settings.json`, so it works in every project. Without it, Gemini CLI saves to the project’s `.gemini/settings.json` and the server only exists in that folder.

**Route 2: the extension.** Run:

```
gemini extensions install https://github.com/lumizone/gsc-magic-agent-plugin
```

The extension registers the same endpoint and ships a `GEMINI.md` that tells the model which tool to use for which question, that Search Console lags a few days, and that write tools need your explicit go-ahead.

**Sign in.** Start `gemini` and type `/mcp`. If GSC Magic still needs authentication, follow the sign-in prompt (or run `/mcp auth gsc-magic`), log in with Google or e-mail in the browser tab that opens, and allow access. Gemini CLI discovers the sign-in from the server, registers itself as a client and stores the token in `~/.gemini/mcp-oauth-tokens.json`. The [Gemini CLI MCP documentation](https://geminicli.com/docs/tools/mcp-server) describes this flow.

**No browser available?** Create an access token in the [GSC Magic dashboard](https://app.gscmagic.com) under Connect, then add the server with a header instead:

```
gemini mcp add --transport http --scope user -H "Authorization: Bearer gsm_YOUR_TOKEN" gsc-magic https://mcp.gscmagic.com/mcp
```

Keep the server name `gsc-magic` with a hyphen. Gemini CLI names tools `mcp_<server>_<tool>` and its policy rules split the name at the first `_`, so a server called `gsc_magic` breaks them. The short version of all this is on the [Gemini CLI integration page](https://gscmagic.com/integrations/gemini-cli).

## How do you check that Gemini CLI reads real data?

Ask for something you can verify in Search Console in under a minute. If the property list matches what you see in the Search Console interface, the connection works. If it is empty, you signed in with a GSC Magic account that has no imported sites.

Gemini CLI asks for confirmation before it runs a tool unless you trusted the server. For read tools I’d choose “always allow” on the GSC Magic server after the first check. Keep confirmations on for anything that writes.

List my Search Console properties and tell me which tool you used.

For the property example.com, give me total Google Web search clicks and impressions for the last 28 complete days. Print the exact start and end dates.

Which day in that range had the most clicks? Show the number so I can check it in the Performance report.

The first prompt should trigger `gsc_list_sites`. The second and third use `gsc_query_analytics` with a `date` dimension. Open the same property, search type and dates in the Performance report and compare. Totals that are close but not identical usually mean the last day is still preliminary.

If the agent answers with numbers and no tool call, stop and ask again. A model without a tool result will happily produce plausible figures.

## How do you check sitemaps against the index from the terminal?

Start with the sitemap list, run the index health report, then inspect only the URLs that look wrong. This order spends Google’s inspection quota on the pages that need it instead of on every URL you own.

1. **`gsc_list_sitemaps`** returns submitted sitemaps with status, errors, warnings and indexed counts. A sitemap with errors is the first thing to fix.
2. **`report_index_health`** reads URLs from your sitemaps, inspects them through the URL Inspection API and groups them by coverage state. You get “crawled, not indexed” and “duplicate without canonical” as lists, not as a guess.
3. **`gsc_inspect_urls_batch`** inspects up to 500 URLs in one call, throttled to stay inside Google’s limits. Google allows 2,000 inspections per day and 600 per minute per property ([usage limits](https://developers.google.com/webmaster-tools/limits) ), so a 500-URL batch is a quarter of a day’s budget.

The terminal part is what comes next. Once the agent has the list of “crawled, not indexed” URLs, it can open the matching source files and check the canonical tag, the `noindex` rule or the missing internal links. For a deeper walkthrough of the quota math, see [inspecting 500 URLs with the Search Console API](https://gscmagic.com/blog/inspect-500-urls-search-console-api).

For example.com, list my submitted sitemaps and flag any with errors or warnings.

Run an index health check on the main sitemap. Group the URLs by coverage state and show the count per state.

For the URLs marked crawled but not indexed, find their source files in this repo and tell me whether each one has a canonical tag, a noindex rule and at least one internal link pointing to it. Do not edit anything yet.

## How do you find quick wins and weak snippets?

Use `report_quick_wins` for query and page pairs ranking in positions 4 to 20 with many impressions, and `report_ctr_outliers` for pages whose CTR is under half of your site’s median at the same position. The first finds pages close to page one. The second finds pages that rank but do not get picked.

Both reports return finished comparisons, so you are not paging through 25,000 raw rows. Ask the agent to keep the impressions, clicks, CTR and position for every row it recommends. A CTR outlier with 40 impressions is noise; one with 4,000 is worth a new title.

Run quick wins for example.com over the last 28 days. Show the top 10 by potential extra clicks with query, page, impressions, CTR and position.

Run CTR outliers for the same period. For each of the top five pages, open its source file in this repo and print the current title tag and meta description.

Draft a new title and meta description for those five pages based on the queries they rank for. Show me the drafts as a table before you change any file.

## How do you check Core Web Vitals without leaving the repo?

Call `cwv_get_origin` for real-user field data and `psi_run_audit` for a Lighthouse lab run on a specific URL. Field data tells you whether real visitors have a problem. The lab audit points at the likely cause.

`cwv_get_origin` returns LCP, INP, CLS, FCP and TTFB for the whole origin over the last 28 days at the 75th percentile, with good, needs-improvement and poor shares. `cwv_get_url` does the same for one URL when it has enough Chrome traffic, and `cwv_history` shows the weekly trend for up to about six months.

When `psi_run_audit` names an oversized hero image or a render-blocking script, the agent can search the codebase for it. That jump from “LCP is poor on mobile” to a specific line, for example a hero component loading an uncompressed image above the fold, is the reason to do this in a terminal next to the code.

Get real-user Core Web Vitals for https://example.com and tell me which metrics are not in the good range on mobile.

Run a PageSpeed audit on https://example.com/pricing on mobile and list the top three opportunities.

Find the files in this repo responsible for those three opportunities and propose a fix for each. Wait for my approval before editing.

## How do you let Gemini CLI change titles, meta and internal links safely?

Let it edit, but only after it shows you a plan, and review the result with `git diff` before you commit. Gemini CLI asks for approval before it writes a file, which gives you a natural checkpoint on every change.

A workflow I’d use on any site repo:

1. Start on a clean branch: `git switch -c seo/titles-november` .
2. Ask the agent to list the pages it wants to change, with the Search Console evidence for each (query, impressions, CTR, position).
3. Approve the plan, then approve each file write as it comes.
4. Run `git diff` and read every changed line. Check that the new title still matches the page’s content and that no internal link points to a redirect.
5. Commit and deploy yourself. Re-check the same pages after the next complete 28-day window.

Changes inside your repo are one thing. Changes in Search Console or Bing are another. Tools like `gsc_submit_sitemap` or `indexnow_submit` exist only in write mode on paid GSC Magic plans, and the agent should call one only after you confirm that exact action. I keep write mode off on accounts where I only need reports.

## How do you set house rules with GEMINI.md?

Put a `GEMINI.md` file in the root of your site repo with the rules you want the agent to follow every time. Gemini CLI concatenates the global `~/.gemini/GEMINI.md`, the files it finds in your workspace and any extension context files, and sends them with every prompt ([GEMINI.md documentation](https://geminicli.com/docs/cli/gemini-md)).

The GSC Magic extension already ships a context file about the tools. Your project file is where your own rules go. For example:

```
# SEO rules for this repo

- Always print the property, search type and exact start and end dates before any number.
- Compare equal periods: last 28 complete days vs the 28 days before.
- Treat pages with fewer than 100 impressions in a period as noise.
- Never call a GSC Magic write tool. Never commit or push.
- Page titles live in each page's frontmatter `title` field; keep them under 60 characters.
```

Run `/memory show` to see the combined context the model receives, and `/memory reload` after you edit the file.

GSC Magic also exposes MCP prompts, which Gemini CLI turns into slash commands: `weekly_seo_report`, `find_quick_wins`, `diagnose_traffic_drop`, `indexing_audit`, `content_refresh_plan` and `core_web_vitals_check`. Typing `/indexing_audit --site="example.com"` runs the whole sitemap and inspection recipe without writing the prompt yourself.

## How does Gemini CLI compare with Claude Code and Cursor for SEO work?

All three can use GSC Magic with the same endpoint and an OAuth sign-in, so pick the one your team already uses. The differences are in where you work and how you give the agent standing rules.

|  | Gemini CLI | Claude Code | Cursor | 
|---|---|---|---|
| Where you work | Terminal | Terminal | Code editor | 
| Add GSC Magic | `gemini mcp add` or the extension | `claude mcp add` or the plugin | Entry in `mcp.json` | 
| Sign-in | `/mcp` , browser OAuth, or a`gsm_` token header | `/mcp` , browser OAuth | Cursor Settings, MCP, OAuth | 
| Project rules file | `GEMINI.md` | `CLAUDE.md` | Cursor rules | 
| Access note | Paid Gemini API key or Code Assist license since June 2026 | Anthropic account | Cursor account | 
| Setup guide | [Gemini CLI](https://gscmagic.com/integrations/gemini-cli) | [Claude Code guide](https://gscmagic.com/blog/connect-google-search-console-to-claude-code) | [Cursor guide](https://gscmagic.com/blog/connect-google-search-console-to-cursor) | 

## What are the limits you should expect?

The agent is only as good as the data it gets, and Search Console data has known gaps. Know them before you show a number to anyone else.

- **Lag.** Search Console data trails by two to three days. Compare complete periods only.
- **Row caps.** One`gsc_query_analytics` request returns up to 25,000 rows, and anonymized queries never appear in query tables. If a result says it was truncated, it is not complete. See[the Search Console 1,000-row limit](https://gscmagic.com/blog/search-console-1000-row-limit) for the difference between interface, export and API limits.
- **Small numbers.** A page going from 6 clicks to 3 is a 50% drop and means nothing on its own.
- **Charts.** GSC Magic can return a PNG chart with`chart: true` , but Gemini CLI passes images to the model and shows a text summary, so you will not see the chart in your terminal. Ask for a table instead.
- **Plan limits.** The Free plan’s 10 calls a day go fast in an agent session that chains several tools. A limit error names the plan, and retrying will not help.

If you are worried about what the connection can access, read [whether a Search Console MCP server is safe](https://gscmagic.com/blog/is-google-search-console-mcp-safe) before you sign in on a client’s property.

## What should you run after the first session?

Save the prompts that worked into your `GEMINI.md` or a notes file, and run the same three checks every month: index health, quick wins and Core Web Vitals. A repeated check against the previous month tells you more than any single deep audit.

If your next question is about Google’s AI features, the companion guide covers [tracking AI Overviews and AI Mode in Search Console](https://gscmagic.com/blog/track-ai-overviews-ai-mode-search-console) and what Search Console can and cannot show about them.

## Frequently asked questions

### Can Gemini CLI read my Google Search Console data?

Not by itself. Gemini CLI reads Search Console only through a tool you connect, such as a remote MCP server. Add GSC Magic with gemini mcp add or the GSC Magic extension, sign in, and the agent can call tools like gsc_list_sites and gsc_query_analytics on the properties you imported.

### Can I use GSC Magic in the Gemini app instead of Gemini CLI?

Not yet. The Gemini app at gemini.google.com has custom MCP connectors for a limited group of users, but GSC Magic does not support connecting from the Gemini app at the moment. Use Gemini CLI, or another client listed on the GSC Magic integrations page.

### Does Gemini CLI still work after the move to Antigravity CLI?

Google said in May 2026 that Gemini CLI would stop serving free, Google AI Pro and Ultra users on June 18, 2026, and stays available with paid Gemini API keys and Gemini Code Assist Standard or Enterprise licenses. Check Google’s current notice for your account type before you plan a workflow around it.

### Can Gemini CLI change my site or submit URLs to Google?

It can edit files in the folder you run it in, and Gemini CLI asks for your approval before it writes a file. On the Search Console side GSC Magic is read-only unless you are on a paid plan with write mode switched on, and even then the agent should only call a write tool after you confirm that exact action.

### Why don’t Gemini CLI’s numbers match the Search Console interface?

Usually the property, search type or date range differs, or the latest days are still preliminary. Search Console data also lags two to three days, query tables hide anonymized queries, and a single API request returns at most 25,000 rows. Ask the agent to print the property, search type and exact dates, then compare the same filters by hand.

## Do this with GSC Magic

The one-command setup, the token fallback and troubleshooting are on the [Gemini CLI integration page](https://gscmagic.com/integrations/gemini-cli). Every other supported client is on the [integrations list](https://gscmagic.com/integrations). [Create a free GSC Magic account](https://app.gscmagic.com/login?mode=signup), import one property and run the first prompt above.

### Give your agent your search data.

GSC Magic connects Claude, ChatGPT and Cursor to Google Search Console, Bing and GA4. Free plan, 7-day Pro trial, no card.

[Start free](https://app.gscmagic.com/login?mode=signup)
