Gemini-cli and SEO

/ Engineering

Recently I pulled some historical data from Google Search Console and wanted to dig deeper into insighter.com.au rankings and CTR. I had Google Analytics and MS Clarity integrated from early on, but interpreting all that data together wasn't straightforward — so I wired it up to Gemini CLI via MCP.

I added the following MCP servers to my Gemini config (settings.json):

{
  "mcpServers": {
    "gsc": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-gsc"
      ],
      "env": {
        "GOOGLE_APPLICATION_CREDENTIALS": "/Users/MY_USERNAME/.config/gcloud/application_default_credentials_analytics_mcp.json",
        "GOOGLE_PROJECT_ID": "My_PROJECT"
      }
    },
    "@microsoft/clarity-mcp-server": {
      "command": "npx",
      "args": [
        "@microsoft/clarity-mcp-server",
        "--clarity_api_token=$MY_SEC_TOKEN"
      ]
    },
    "analytics-mcp": {
      "command": "pipx",
      "args": [
        "run",
        "analytics-mcp"
      ],
      "env": {
        "GOOGLE_APPLICATION_CREDENTIALS": "/Users/$MY_USERNAME/.config/gcloud/application_default_credentials_analytics_mcp.json",
        "GOOGLE_PROJECT_ID": "MY_GCP_PROJECT"
      }
    },
    "playwright": {
      "command": "npx",
      "args": [
        "@playwright/mcp@latest"
      ]
    },
 ...
 ...

Gemini can now:

  1. Read the codebase.
  2. Pull GA4 data, including Search Console metrics surfaced via the GA4 integration.
  3. Pull of datafrom GSC (direct).
  4. Query MS Clarity for dead clicks, rage clicks, and scroll depth.
  5. Use Playwright to render pages as a real browser would — catching JS-rendered content issues that a plain HTTP request would miss.

With all sources in context, a single prompt can ask Gemini to cross-reference them and run a full audit.

What it actually found

Several issues that wouldn't have surfaced from GSC data alone:

  • Metadata and title improvements — mismatches between page titles and top-ranking queries which were not found just with code audit.
  • H1 and content retention — Clarity scroll data revealed users were dropping off before reaching key content, which correlated with thin H1s that didn't set expectations well.
  • A few other minor issues caught by combining rendered page state (Playwright) with behavioural signals.

The point isn't that any single finding was surprising — it's that the combination of sources gave enough context to connect the dots without jumping between four dashboards manually.

Is this better than ahrefs-mcp?

Probably not. Ahrefs has backlink data, keyword difficulty, competitor analysis — none of which this setup provides. But for auditing your own site's on-page issues using data you already have, this is free, good enough, and takes about 10 minutes to set up.

Tags: #ai #SEO #gemini-cli