Skip to the guide

Guide · Claude Code and SEO

Connect Claude Code to Search Console, and stop exporting spreadsheets

Twenty minutes of one-time setup, then you can ask your site's search data questions in plain language: which page dropped this month, which queries are stuck on page two, and what Google won't index at all.

9 min readUpdated August 2026Written by Naomi Sharabi, MOVE

Why connect them at all

Day-to-day work in Search Console is mostly repeated pulls: open the interface, pick a date range, filter, export, and cross-reference in a spreadsheet against last month's export. The interface is great for one-off digging, and less good for questions that mix several cuts - like "which pages lost clicks this month even though impressions went up".

Connecting Claude Code to Search Console moves those questions into a conversation. You phrase the question in words, Claude pulls the data through the API, cross-references it and returns a table or a conclusion. It isn't magic and it doesn't replace thinking - it cuts the time to pull data from fifteen minutes to thirty seconds, and that's the difference between checking once a month and checking whenever you feel like it.

Who this is especially for

Anyone managing more than one property. Once you have three or more clients, the time saved on manual exports and cross-referencing pays back the twenty minutes of setup in the very first week.

How the connection works under the hood

MCP - short for Model Context Protocol - is an open standard that lets external tools expose their capabilities to a model. An MCP server is just a small program running on your computer that announces a list of actions and knows how to perform them against an external service. Claude Code knows nothing about Search Console in advance; it only sees the list of actions the server exposes, and calls them as needed.

Your computerClaude CodeYour terminalMCP servermcp-search-consoleRuns locally, separate processstdioHTTPSOAuth tokenSearch Console APIsearchconsole.googleapis.comThe property your account can accessQueries, clicks, impressions and index status come back to the chat as text
DiagramThe whole connection runs locally. The MCP server is the only process holding your credentials, and it talks directly to Google's API.

An important point for peace of mind: there's no third-party server in the middle. The credentials file sits on your disk, the server runs on your machine, and the only traffic leaving it goes from your computer to Google.

What to prepare first

  • Claude Code installed and working in your terminal.
  • Python 3.11 or newer. Version 3.10 and older will fail, sometimes silently - this is trap number one in this setup.
  • A Google account with access to the property in Search Console. View access is enough for every pull; owner access is needed only for write actions such as submitting a sitemap.
  • A Google Cloud project. You can create a new one for free in a minute; no credit card is needed to use the Search Console API.
1

Install uv

2 minutes

uv is a fast package manager for Python. You need it because it comes with uvx, which runs Python tools in an isolated environment without installing anything globally - so the MCP server doesn't clash with anything else you have installed.

macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/env
Windows · PowerShell
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Check that the install worked. If the command returns a version number, you're good to go.

Check
uv --version
2

Enable the API and create credentials

8 minutes

Two things happen here: you enable the Search Console API in your cloud project, then create the credentials that let the server talk to it on your behalf.

First - which kind of credentials

There are two ways, and the choice changes how much work you'll have later. In the vast majority of cases, OAuth is the right answer.

Who needs to access the data?OAuthMe, with my own Google accountSign in once in the browserSees every property you can accessZero permission setup per propertyAlmost always the right choiceService accountA machine, no person signing inA JSON key file, no browserMust be added as a user on every propertySuited to automation and serversOnly when nobody is there to click "Allow"
DiagramA service account requires adding its email address as a user on each property separately. OAuth simply inherits the permissions you already have.

Enable the API

  • Go to console.cloud.google.com and pick an existing project or create a new one.
  • In the search bar at the top, type Search Console API, open the result and click Enable.

Create an OAuth client ID

Go to APIs & Services · Credentials, click Create credentials and choose OAuth client ID. The application type field is the critical one: choose Desktop app, because the code runs on your computer, not on a web server.

console.cloud.google.com/apis/credentialsAPIs & Services · CredentialsCreate OAuth client IDApplication typeDesktop appThe right type - Claude Code runs on your machine, not a web serverOAuth client createdclient_secret_xxx.jsonDownload JSONSave this file →
Screen illustrationThe OAuth client ID screen. When you're done, download the JSON file and keep it somewhere permanent - you can't download it again.

This file is a secret

The JSON file you downloaded is equivalent to a password. Don't commit it to Git, don't send it on Slack and don't keep it in your project folder. A good place: ~/.config/gsc/client_secrets.json, and on Windows an equivalent folder under your user profile.
3

Connect the server to Claude Code

3 minutes

Now add the server. Notice the structure of the command: everything before the -- is a flag for Claude Code itself, and everything after it is the command that runs the server.

Add the server
claude mcp add --scope user -e GSC_OAUTH_CLIENT_SECRETS_FILE=/Users/me/.config/gsc/client_secrets.json gsc -- uvx mcp-search-console
  • --scope user makes the server available in all your projects, not just the current folder. Without this flag the default is local, meaning this folder only.
  • -e sets an environment variable for the server. The path must be full and absolute - a relative path or ~ will make the server crash on startup.
  • gsc is the name you'll see later in /mcp. You can choose any name.

A silent trap in the flag order

Don't write the server name right after -e. The flag swallows multiple values, so it will read the name as another KEY=value pair and return an error. In the command above, the server name comes after the variable's value, which is exactly the right order.

If you went with a service account, these two environment variables replace the one above:

Alternative · service account
claude mcp add --scope user \
  -e GSC_CREDENTIALS_PATH=/Users/me/.config/gsc/service_account.json \
  -e GSC_SKIP_OAUTH=true \
  gsc -- uvx mcp-search-console
4

Verify the connection actually works

5 minutes

First, check that the server loaded. This command shows a health status next to each connected server.

claude mcp list
$ claude mcp list
Checking MCP server health…

gsc: uvx mcp-search-console - ✔ Connected

The first time you ask for data, a browser will open and ask you to approve access to your Google account. This happens once; after you approve, a token is saved and the connection stays active. Now for the real test - open claude and ask:

claude
$ claude
> List all the properties I have in Search Console

● gsc - list_properties
  sc-domain:example.com          owner
  https://shop.example.com/      full

If the list comes back empty

It almost always means you signed in with a different Google account from the one that has access to the property, or - if you chose a service account - that you didn't add its email address as a user on the property. An empty list is a valid API response, not an error, which is why it's confusing.

What you can ask now

The server exposes around twenty actions, but you don't need to remember them. Phrase the question in plain language, and Claude picks the right action. The four capability families:

5 toolsPerformance
Clicks, impressions, CTR and position - by query, page, country or device
2 toolsPeriod comparison
What changed between this month and last, and which page caused the drop
3 toolsIndexing
Inspect a single URL or a batch, and find pages Google won't index
3 toolsSitemaps
Your sitemaps, when they were last read and how many URLs were discovered
DiagramWhat opens up once the connection works. The technical names are just for reference - in practice you ask in words.

Good questions to start with

  • "Compare the last 28 days with the previous period, and show me the ten pages that lost the most clicks."
  • "Which queries rank in positions 11 to 20? Those are the closest opportunities for page one."
  • "Take these five URLs and check for each one whether it's indexed, and when it was last crawled."
  • "Which page got high impressions with an especially low CTR? That's probably a title or description problem."

The trick that doubles the value

When you work inside your site's folder, Claude can read both the code and the search data in the same conversation. Instead of "this page lost clicks", you can ask "find out why, and suggest a fix to the title and description in the file itself" - diagnosis and fix in one go.

Six traps that will cost you an hour

  1. 01

    Python 3.10 or older

    The server needs 3.11 at minimum, and the failure isn't always explicit. If the server won't start, this is the first thing to check: uv python list.

  2. 02

    A relative path or ~ for the credentials file

    The server runs as a separate process with its own working directory. Always use a full, absolute path, on Windows too.

  3. 03

    A service account that wasn't added to the property

    The most common reason for an empty property list. Go to Search Console, Settings, Users and permissions, and add the service account's email address.

  4. 04

    The server name right after -e

    The flag swallows multiple values and will read the name as an environment variable. Put the server name after the variable's value.

  5. 05

    Domain property vs URL prefix

    Two completely different properties with different numbers. sc-domain:example.com covers every subdomain and protocol; https://example.com/ covers only that exact prefix.

  6. 06

    Comparing against yesterday's data

    Google's most recent data isn't final and keeps updating for 2-3 days. For serious comparisons, end your date range three days before today.

FAQ

Does this connection send my property's data to an outside server?
No. The MCP server runs on your computer as a local process and talks directly to Google's API. The data that comes back enters your conversation with Claude, exactly like any other text you paste into the chat. There's no third-party server in between.
Do I need a paid Search Console plan?
There's no paid plan. Search Console and the Search Console API are free. What does exist are API rate limits, and in a single SEO person's normal work you won't hit them.
Can I connect Google Analytics 4 too?
Yes, it's a separate MCP server with its own credentials. The principle is the same: enable the API in the cloud, create credentials, and add the server with claude mcp add. It's worth connecting both only once Search Console is working smoothly.
Why doesn't the data in the chat match what I see in the interface?
Two common reasons: Google's freshest data isn't final and keeps updating for 2-3 days, and you need to make sure you're asking about the same kind of property - a Domain property and a URL prefix property are two different properties with different numbers.
Does this replace SEO tools like Screaming Frog or Ahrefs?
No. It gives you fast, natural-language access to data you already have in Search Console, and saves manual exports to spreadsheets. Backlink analysis, site crawling and competitor analysis stay in the dedicated tools.

Sources

Want your website to show up in AI answers, not just on Google?

We build websites with SEO and GEO built in - one fixed price, live within 14 days, no retainer.