---
title: I connected Search Console to my agent instead of opening dashboards — the first question found my site indexed twice
date: 2026-08-09
tags: [seo, search-console, mcp, agents, analytics]
type: success
reproducible: true
---

In plain words: Search Console is the free Google tool that tells you which searches show your site, where you rank and what people click. Checking it means opening a dashboard, choosing a date range, clicking through tabs — for each site you own. I have seven. I stopped opening dashboards and gave the data to my coding agent instead, so I can ask questions in a sentence and get an answer about all of them.

The connection is an MCP server: [AminForou/mcp-gsc](https://github.com/AminForou/mcp-gsc). It authenticates once with a Google OAuth client you create yourself, then exposes Search Console as tools an agent can call — properties, search analytics, URL inspection, sitemaps. It works with Claude, Cursor, Codex, Gemini CLI and anything else that speaks MCP. Nothing is uploaded anywhere: the server runs locally and talks to Google's API with my own credentials.

The point is not automation of a report I already read. It is that questions became cheap. "Which of my sites got impressions this month?" is one sentence, not seven dashboards.

The first real question I asked produced something I did not want to see. I asked which pages of my own new site were appearing in search — and half the rows came back as `www.worklore.dev`, not `worklore.dev`. I checked: the www host answers 200 instead of redirecting, and the pages carry no canonical tag. Google has been indexing the same site under two hostnames and splitting the signals between them. This is exactly the www→apex redirect I had already fixed on my other site during an audit — the new site never got it. I would not have noticed from a dashboard, because I would not have thought to look.

The second answer was quieter but just as useful: several pages rank in the top ten with impressions and zero clicks. Position is not the problem. The title and description are.

## Reproduce this

**Prerequisites:** a verified Search Console property; Python 3.10+; an MCP-capable agent (Claude Code, Cursor, Codex, Gemini CLI…); a Google Cloud project where you can create an OAuth client.

**Your agent will need from you:** which properties matter, and the path where you saved the OAuth client secrets JSON.

**Steps:**
1. Clone [AminForou/mcp-gsc](https://github.com/AminForou/mcp-gsc) and install it in a virtualenv per its README.
2. In Google Cloud, enable the Search Console API and create an **OAuth client (Desktop app)**; download the client secrets JSON to a path outside any repo.
3. Register the server with your agent, pointing `GSC_OAUTH_CLIENT_SECRETS_FILE` at that JSON. Set `GSC_DATA_STATE=all` if you want fresh, not-yet-finalised data.
4. Restart the agent and have it list your properties — this triggers the one-time browser consent.
5. Ask the questions a dashboard makes tedious, starting with these three, which is where my findings came from:
   - "Which pages got impressions in the last 28 days?" — read the **hostnames**, not just the paths. Two hostnames means duplicate indexing.
   - "Which queries rank in the top 10 with zero clicks?" — that is a title/description problem, not a ranking problem.
   - "Compare this month with last month by query" — for what moved.
6. Fix what it finds. Duplicate hostnames: redirect one to the other at the CDN and add a canonical tag.

**Verify:** `curl -sI https://www.your-domain/` must return a 301 to the apex (or the reverse — pick one), and `curl -s https://your-domain/ | grep canonical` must show a canonical tag. Then re-ask question one in a week: the rows should all carry one hostname.
