Skip to main content
Glama
gsc-mcp
by xevrion
README.md
# gsc-mcp

**Google Search Console for Claude, Cursor, and every other AI app. Free, open source, runs on your machine.**

Ask your AI "why did my traffic drop?" and get an actual answer: the day it broke, whether it lines up with a Google update, and which pages lost clicks because they ranked worse, got clicked less, or because fewer people searched.

[![npm](https://img.shields.io/npm/v/@xevrion/gsc-mcp)](https://www.npmjs.com/package/@xevrion/gsc-mcp)
[![CI](https://github.com/xevrion/gsc-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/xevrion/gsc-mcp/actions/workflows/ci.yml)
[![license](https://img.shields.io/badge/license-MIT-blue)](LICENSE)

```bash
npx -y @xevrion/gsc-mcp setup
```

That's the whole install. It signs you in with Google, finds the AI apps on your computer (Claude Code, Claude Desktop, Cursor, Windsurf, VS Code, Gemini CLI, Codex) and adds itself to each one.

**Just want to look first?** `npx -y @xevrion/gsc-mcp demo` adds it with a realistic made-up site, no Google account needed. Every tool works on it.

---

## What you can ask

> How is my site doing on Google this month?
>
> Why did my traffic drop in September?
>
> Which keywords am I close to page one for, and what should I change?
>
> Are any of my pages competing with each other?
>
> Which pages in my sitemap is Google ignoring, and why?
>
> Did the November core update hurt me?
>
> Is my blog section growing or shrinking?

Here's a real answer from the demo site:

```
diagnose_traffic_drop · sc-domain:brewguide.coffee · 2026-08-28 to 2026-11-25
Clicks 23,783 vs 26,506 (-10.3%, -2,723).

Trend break: around 2026-08-08, daily clicks went from ~302 to ~265.
Matches a Google update: August 2026 spam update (2026-08-18 to 2026-08-21).

| cause                      | clicks Δ |
| CTR drops at similar rank  | -2,752   |
| Ranking drops              | -16      |
| Lower search demand        | +45      |

| page                       | clicks Δ | cause | detail                                   |
| /blog/french-press-ratio   | -2,752   | ctr   | CTR 17.0% → 12.3% at a similar position  |
```

A drop in CTR at the same ranking usually means a new AI Overview or a weaker title. The tool tells you which one you're dealing with, so you fix the right thing.

## Why this one

Lots of Search Console MCP servers exist. Most of them pass Google's raw JSON to the model and stop there. This one does the analysis too, and it was built after going through the issue trackers of the popular ones to see what people kept running into.

- **Setup a non-developer can finish.** One command does everything, including adding itself to your apps. It opens each Google page for you and picks up the downloaded key on its own. If something isn't connected, your AI can start the sign-in from the chat.
- **Answers, not data dumps.** 21 tools, and most of them answer a question directly: drop diagnosis, quick wins, weak titles, cannibalization, content decay, indexing audits, update impact.
- **Benchmarks from your own site.** "Expected CTR" comes from your own data, not an industry table. A site that normally gets 0.6× typical CTR won't have every page flagged, and a strong brand won't hide its weak pages.
- **Cheap on tokens.** Output is compact tables with shared URL prefixes folded into the header, about 2.6× smaller than the raw JSON most servers return (8.6k vs 22k characters for the same 100 rows). All 21 tools together cost about 5k tokens of context, and `GSC_TOOLS` trims them further. Results always say when they were cut off.
- **Fast.** Starts in about 0.4 s. Requests run in parallel, and repeated queries come from a 10-minute cache, so a full SEO report mostly reuses data it already fetched.
- **Right about your property.** `example.com`, `https://www.example.com/blog/post` and `sc-domain:example.com` all resolve to the right property, every time. It never picks `myexample.com`, and it asks when it can't tell.
- **The 2026 API.** Hourly data, Google's branded query classification, `webMultimodal` (Lens and Circle to Search), and multi-value country and device filters.
- **Safe by default.** It's read-only unless you opt in. There's no telemetry, it never talks to a server of ours, and tokens are stored with 0600 permissions.
- **Tested.** 163 tests, plus runs against real Search Console accounts. They cover pagination boundaries (exactly 25,000 rows), timezone edges, retries, multi-account routing and installer edge cases. CI runs on Linux, macOS and Windows.

## Tools

| Tool | What it answers |
| --- | --- |
| `site_overview` | How is the site doing: totals against the previous period and last year, top queries and pages with changes, devices, countries, data freshness, share of clicks from hidden queries |
| `diagnose_traffic_drop` | Why traffic changed: the trend-break day, matching Google updates, and each loss split into lost / ranking / CTR / demand |
| `update_impact` | How every confirmed Google update in the last 16 months affected the site |
| `find_anomalies` | Days that broke from the normal weekly pattern (outages, spikes, tracking gaps) |
| `compare_periods` | Biggest winners and losers by query, page, country, device |
| `find_opportunities` | Striking-distance keywords ranked by extra clicks they could get |
| `find_low_ctr` | Pages that rank fine but don't get clicked (title and description fixes) |
| `find_cannibalization` | Queries split across several of your pages, with daily evidence of Google swapping between them |
| `find_content_decay` | Pages in steady decline over months, with the likely cause |
| `analyze_queries` | Search intent breakdown, long AI-style questions, and topic clusters |
| `brand_split` | Branded vs non-branded traffic |
| `section_report` | Performance by folder (/blog/, /products/, ...) |
| `page_report` | Everything about one URL: queries, trend, devices, index status |
| `all_sites_overview` | Every property side by side |
| `search_analytics` | Raw data with any dimensions and filters, auto-paginated past 25k rows; table, JSON or CSV |
| `audit_indexing` | Sitemap URLs with zero impressions, inspected to show why |
| `inspect_url` | Index status for up to 100 URLs: coverage, canonical, robots, rich result issues |
| `page_speed` | Core Web Vitals from real users plus Lighthouse, with the biggest fixes |
| `list_sitemaps`, `list_sites` | What's submitted and what you can access |
| `connect_account` | Sign in from inside the chat |

Turn on `GSC_ALLOW_WRITES=1` for `submit_sitemap`, `delete_sitemap`, `add_site`, `delete_site` and `request_indexing`.

It also ships five prompts your app can show as shortcuts: **SEO report**, **Why did my traffic drop?**, **Quick wins**, **Indexing check**, **Content refresh plan**.

## Authentication

### The easy way

```bash
npx -y @xevrion/gsc-mcp setup
```

Google requires each person to have a free "OAuth client", which is a key that lets an app ask for your permission. It lives in a Google Cloud project. That sounds heavy, but it's free and needs no billing or card, and your data still goes straight from Google to your computer. Setup opens each page for you:

1. [Create a project](https://console.cloud.google.com/projectcreate) (any name)
2. [Turn on the Search Console API](https://console.cloud.google.com/apis/library/searchconsole.googleapis.com)
3. [Get started](https://console.cloud.google.com/auth/overview/create): app name, your email, audience **External**, agree, Create
4. [Branding](https://console.cloud.google.com/auth/branding): Google won't publish the app without a home page and privacy policy, so you can use this project's: home page `https://github.com/xevrion/gsc-mcp`, privacy policy `https://github.com/xevrion/gsc-mcp/blob/main/PRIVACY.md`, authorised domain `github.com`. Save.
5. [Audience](https://console.cloud.google.com/auth/audience): click **Publish app**. If you skip this, Google signs you out every 7 days.
6. [Create a client](https://console.cloud.google.com/auth/clients/create): type **Desktop app**, then **Download JSON**

Setup notices the file in your Downloads folder and opens Google sign-in. (On macOS your terminal may ask for permission to read Downloads. If you say no, setup lets you paste the file path instead.) Google may warn that the app is unverified. That's expected, because it's your own app: click **Advanced**, then **Go to ... (unsafe)**.

A one-click "Sign in with Google" that skips all of this is on the roadmap. It needs a shared app verified by Google, which is in progress.

### Several Google accounts

```bash
npx -y @xevrion/gsc-mcp auth --profile client-a
npx -y @xevrion/gsc-mcp auth --profile client-b
```

Every saved account is used at once, and each property goes through whichever account can see it. Agencies just name the site. Set `GSC_PROFILE` to pin a single account.

### Service account

For servers and CI: set `GSC_SERVICE_ACCOUNT` to the key file path or the JSON itself. Then add the service account's email as a user on each property (Search Console › Settings › Users and permissions).

### Application Default Credentials

`gcloud auth application-default login --client-id-file=client.json --scopes=https://www.googleapis.com/auth/webmasters.readonly` works too. Google blocks gcloud's built-in client for this scope, so the client file is required.

## Manual setup

If `setup` didn't find your app, add this to its MCP config:

```json
{
  "mcpServers": {
    "search-console": {
      "command": "npx",
      "args": ["-y", "@xevrion/gsc-mcp"]
    }
  }
}
```

- **Claude Code**: `claude mcp add --scope user search-console -- npx -y @xevrion/gsc-mcp`. It's also a plugin: `/plugin marketplace add xevrion/gsc-mcp`, then `/plugin install search-console@gsc-mcp`. The plugin bundles a skill that teaches Claude which tool to use when.
- **Claude Desktop**: download `gsc-mcp.mcpb` from the [latest release](https://github.com/xevrion/gsc-mcp/releases) and double-click it.
- **VS Code**: uses `"servers"` instead of `"mcpServers"` and needs `"type": "stdio"`.
- **Codex**: `~/.codex/config.toml` → `[mcp_servers.search-console]` with `command = "npx"` and `args = ["-y", "@xevrion/gsc-mcp"]`.

## Configuration

| Variable | What it does |
| --- | --- |
| `GSC_DEFAULT_SITE` | Property to use when a request doesn't name one |
| `GSC_ALLOWED_SITES` | Comma-separated list; the AI can only see these properties |
| `GSC_TOOLS` | Load only some tools, to save tokens: families `core`, `insights`, `indexing`, `write`, or tool names |
| `GSC_ALLOW_WRITES=1` | Enable tools that change things |
| `GSC_PROFILE` | Use one saved account instead of all of them |
| `GSC_SERVICE_ACCOUNT` | Service account key path or JSON |
| `GOOGLE_API_KEY` | Optional key for `page_speed` when the shared PageSpeed quota runs out |
| `GSC_DEMO=1` | Synthetic demo data |

## Command line

Every tool also runs from a terminal, which is handy for scripts and cron:

```bash
npx -y @xevrion/gsc-mcp tools
npx -y @xevrion/gsc-mcp run find_opportunities --site example.com --brand "acme" --limit 10
npx -y @xevrion/gsc-mcp run search_analytics --site example.com --dimensions date --format csv > clicks.csv
npx -y @xevrion/gsc-mcp status    # checks credentials, properties, and which apps have it
```

## Remote / Docker

```bash
GSC_HTTP_TOKEN=$(openssl rand -hex 32) npx -y @xevrion/gsc-mcp serve --http --port 3000
docker build -t gsc-mcp . && docker run -p 3000:3000 -e GSC_HTTP_TOKEN=... -e GSC_SERVICE_ACCOUNT="$(cat key.json)" gsc-mcp
```

Streamable HTTP lives at `/mcp`, and `/health` is for load balancers. It won't listen on a public interface without a token.

## How the analysis works

Nothing hidden, so you can judge whether to trust it.

- **Expected CTR**: a CTR-by-position curve fitted to your own query rows. It starts from a site-wide factor (the median of each query's CTR over a standard curve), and each position's median is blended in according to how much data backs it. Outliers can't drag down their own benchmark, and small sites still get sensible numbers.
- **Opportunities**: impressions × expected CTR at the target position, minus the clicks you already get.
- **Drop attribution**: each page or query is checked in order. It either disappeared, lost at least 1 position (0.5 inside the top 3), lost 25%+ CTR at a steady position with steady impressions, or simply had less search demand.
- **Trend break**: the split point that maximizes the weighted difference in mean daily clicks. Google updates come from the public [Search Status Dashboard](https://status.search.google.com/).
- **Decay**: a least-squares line over consecutive 28-day periods. A page is flagged only when the fit is solid (R² ≥ 0.5) and the late half averages at least 25% below the early half, so one bad month never counts.
- **Cannibalization**: queries where 2+ pages each hold 10%+ of impressions, scored with 1 − HHI and ranked by impressions at stake. The worst five also get a day-by-day check of how often Google swapped the top page.
- **Anomalies**: each day compared with the same weekday over the previous four weeks, so weekends aren't flagged as outages.
- **Topics**: queries grouped by their most distinctive shared word (√impressions × IDF).

Search Console only reports top rows and hides rare queries. `site_overview` tells you what share of clicks that is, so you know how much of the picture you're seeing.

## Development

```bash
npm install
npm test          # 163 tests, no Google account needed
npm run build
npm run smoke     # real stdio server, demo data, every tool
npm run inspect   # MCP Inspector
```

See [CONTRIBUTING.md](CONTRIBUTING.md). Issues and ideas are welcome, especially "I wish I could ask it X".

## License

MIT

TDQS

A3.6/5.0

Scored across 21 tools

Disambiguation4/5

Each tool targets a distinct analysis type and descriptions include explicit 'use this for...' guidance (e.g. find_opportunities vs find_low_ctr vs find_cannibalization are cleanly separated by intent). The only real overlap cluster is the change-over-time family (diagnose_traffic_drop, find_content_decay, find_anomalies, compare_periods, update_impact), where an agent could occasionally pick the wrong lens, but the descriptions disambiguate well.

Naming Consistency3/5

There is a clear verb_noun camp (connect_account, list_sites, search_analytics, compare_periods, find_*, inspect_url, audit_indexing, list_sitemaps) mixed with a noun-only camp (site_overview, all_sites_overview, page_report, section_report, brand_split, page_speed). Both styles are readable and mostly semantic, but the mix means there is no single predictable pattern an agent can rely on to guess a name.

Tool Count4/5

21 tools is on the heavy side, but this is a broad analytics domain (acquisition, indexing, CWV, sitemaps, multi-site) where each tool maps to a genuinely different analysis rather than filler. A few could arguably be folded together (e.g. find_low_ctr into find_opportunities, page_report into section_report), which keeps it below a 5.

Completeness4/5

Coverage is strong across the GSC lifecycle: auth, property listing, performance queries, period comparison, diagnostics, indexing inspection, CWV, and sitemap listing, with sensible multi-site support. Gaps are minor but real: sitemap submission/edit is missing (list only), and there is no way to record annotations or export/share a report, though agents can work around both.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues