# Search Console + GA4 MCP

> Your Search Console and GA4 data, analysed by your AI agent.

Read-only MCP server for Google Search Console and GA4: 15 tools incl. striking-distance keywords, pages losing clicks, content decay and cannibalization.

- Type: MCP Server
- Price: €79, one-time purchase, 12 months of updates, downloads forever
- URL: https://provencart.com/products/search-console-ga4-mcp

## SEO answers without the spreadsheet

Most SEO questions are not hard, they are tedious. *Which pages lost clicks this month and why? Which keywords sit on page two with real impressions? Are two of our articles competing for the same query?* Answering them means exporting from Search Console, pivoting in a spreadsheet, cross-checking GA4. Every week, for every client.

Search Console + GA4 MCP lets your AI agent do that work. It connects Claude, Cursor, VS Code, Codex or any MCP client to **Google Search Console** and **Google Analytics 4** with read-only access, and ships the analyses as ready-made tools, so the agent doesn't have to improvise them from raw rows.

## 15 tools, all read-only

**Search Console (4)**: list properties; performance queries by query, page, country, device, date or search appearance with filters, all search types (web, image, video, news, Discover) and pagination; sitemaps with errors and warnings; URL Inspection for up to 20 URLs (index verdict, last crawl, Google vs. declared canonical, rich result issues).

**GA4 (7)**: list properties; any Data API report with filters and ordering; realtime; a dimension/metric lookup incl. custom definitions; traffic by channel, landing pages and key events, each with comparison to the previous period or last year.

**SEO analyses (4)**:

- **Striking distance**: query + page pairs at average position 8–20 with real impressions, ranked by estimated extra clicks, brand terms excluded on request.
- **Pages losing clicks**: period-over-period or year-over-year, with a likely cause per page (rankings, demand, CTR, lost visibility) and the queries that lost the most.
- **Content decay**: pages whose clicks fell steadily over several consecutive periods from their peak, the classic refresh list.
- **Cannibalization**: queries where two or more of your URLs each take a real share of impressions.

Plus **3 prompts**: a weekly SEO review, a content refresh plan (refresh, merge or leave per page) and a keyword opportunities brief.

## Made for agencies, fine for one site

Authenticate with a **service account**: add its email to each client's Search Console and GA4 property, and one server answers for all of them (pass the site or property per question). Or use an **OAuth refresh token** for your own Google account; a built-in `auth` command handles the browser sign-in.

## Honest numbers

Search Console data lags about three days, so ranges end three days ago by default. Analyses page through the 25,000-row API limit and tell you when results were cut off. Estimates are labelled as estimates. CTR comes as a percentage, not a fraction the model might misread.

## Private by design

The server requests only `webmasters.readonly` and `analytics.readonly`. It cannot change anything in your Google accounts. It talks to Google's APIs directly: no googleapis SDK, no proxy, no telemetry.

## What you need

Node.js 20+, a Google Cloud project with three free APIs enabled, and a service account key or OAuth client. The README walks you through both, screen by screen.

## Outcomes

- A weekly SEO review in one prompt instead of an afternoon of exports
- A ranked list of quick wins: keywords just off page one
- Click losses explained: rankings, demand or CTR
- Refresh, merge or leave decisions for decaying and competing pages

## Features

- **4 SEO analyses built in**: Striking distance, pages losing clicks, content decay and cannibalization as single tool calls, not ad-hoc spreadsheets.
- **Full Search Console access**: Performance by any dimension with filters and pagination, sitemaps, and URL Inspection for up to 20 URLs per call.
- **GA4 reports with comparison**: Traffic by channel, landing pages and key events with change vs. previous period or last year, plus any custom report.
- **Service account or OAuth**: One service account for all client properties, or your own Google account via the built-in auth command.
- **Read-only scopes**: Only webmasters.readonly and analytics.readonly are requested. The server cannot modify anything.
- **Agent-friendly output**: Flat rows, CTR in percent, positions rounded, truncation flagged, clear hints for permission and API errors.

## Who it is for

- SEO consultants and agencies reporting on many sites
- In-house marketers who own organic traffic
- Developers and content teams deciding what to update next

## What's inside

- `src/`: TypeScript source: 15 tools, 3 prompts, Google auth (JWT + refresh token), OAuth helper
- `dist/`: Prebuilt JavaScript, runs with node dist/index.js
- `test/`: Vitest unit tests with mocked Google API responses
- `README.md / README.de.md`: Service account and OAuth setup step by step, client configs, tool reference
- `.env.example`: Every configuration option, documented
- `Dockerfile`: Container image for stdio or HTTP mode
- `LICENSE.md, CHANGELOG.md`: Commercial license and version history

## Example: Pages losing clicks

```text
Which pages lost the most organic clicks in the last 28 days vs. the 28 days before, and why?
```

```text
Site clicks: 18,240 vs. 21,950 (−16.9%). The drop is concentrated on 4 pages:

1. /blog/woocommerce-speed/ −930 clicks. Position 2.8 → 6.1 for "woocommerce speed" and "woocommerce slow": a rankings drop, not demand. Worth a refresh.
2. /guides/core-web-vitals/ −410. Impressions −35%, position stable: seasonal demand, no action.
3. /tools/image-compression/ −260. Position stable, CTR 6.2% → 3.9%: likely a new SERP feature or a weaker snippet. Test a new title.
4. /blog/lazy-load-2023/ −190. No impressions at all now: check whether it was redirected or noindexed (gsc_inspect_url).

(Used seo_pages_losing_clicks with include_top_queries: 3.)
```

## Installation

1. Unzip and build (a prebuilt `dist/` is included):

   ```bash
   cd search-console-ga4-mcp && npm install && npm run build
   ```

2. In Google Cloud Console enable **Google Search Console API**, **Google Analytics Data API** and **Google Analytics Admin API**, create a **service account** and download a JSON key.

3. Add the service account email as a user in **Search Console** (Restricted) and in **GA4 → Property access management** (Viewer).

4. Register the server, e.g. in Claude Code:

   ```bash
   claude mcp add search-console \
     -e GOOGLE_APPLICATION_CREDENTIALS=/absolute/path/to/key.json \
     -e GSC_SITE_URL=sc-domain:example.com \
     -e GA4_PROPERTY_ID=123456789 \
     -- node /absolute/path/to/search-console-ga4-mcp/dist/index.js
   ```

   Prefer your own Google account? Create a Desktop OAuth client and run `node dist/index.js auth` to get a refresh token. Configs for Claude Desktop, Cursor, VS Code and Codex are in the README.

5. Ask: *"Find striking-distance keywords for my site."*

## Requirements

- Node.js 20 or newer (or Docker)
- Google Cloud project with Search Console API, Analytics Data API and Analytics Admin API enabled (free)
- A service account key or an OAuth client (Desktop app) with access to your properties
- An MCP client such as Claude Code, Claude Desktop, Cursor, VS Code or Codex

## FAQ

**Can the server change anything in Search Console or GA4?**

No. It only requests the read-only scopes webmasters.readonly and analytics.readonly and has no write tools, so it cannot submit sitemaps, change settings or delete data.

**How are my Google credentials handled?**

The service account key or refresh token stays in your MCP client config or environment on your machine. Access tokens are kept in memory only and never appear in tool output or logs. Traffic goes only to Google's APIs and, if you set a license key, once to provencart.com for the license check.

**Service account or OAuth, which should I use?**

Agencies: a service account. Add one email to every client property and a single server can answer for all of them. Freelancers or single sites: OAuth with your own account via the built-in auth command is quicker if your organisation blocks service account keys.

**Why does Search Console data end three days ago?**

Google finalises Search Console data with a delay of roughly two to three days, so the tools default to ending ranges three days ago to avoid comparing incomplete days. You can request fresh, not yet final data with data_state: "all".

**Can I run it on a server for my team?**

Yes. Besides stdio it runs as a Streamable HTTP server (--http --port) with an optional bearer token, and a Dockerfile is included. Keep it behind TLS if it leaves your machine.

**How do updates and licensing work?**

You get 12 months of updates from your ProvenCart library; downloaded versions keep working forever. The license covers unlimited own and client projects; reselling or redistributing the files is not allowed. Setting PROVENCART_LICENSE_KEY enables an optional check (key, product and an anonymous installation ID) that only logs a message and never blocks the server.

**Can I get a refund?**

It's a digital product: at checkout you agree that the download starts immediately, so the statutory right of withdrawal expires (§ 356 (5) BGB). If something doesn't work for your setup, write us via the support page and we'll help you get it running.

Keywords: Search Console MCP, GA4 MCP server, Google Analytics MCP, Google Search Console API, SEO AI agent, striking distance keywords, content decay, keyword cannibalization, Claude SEO, Model Context Protocol, GA4 Data API
