Skip to main content
Glama
Google Search Console MCP Server

Google Search Console MCP Server

Google Search Console MCP server

npm CI License: MIT

Connect Claude Desktop, Claude Code or any other MCP client to Google Search Console and use your real search data to improve the SEO of your websites and landing pages.

Ask things like:

  • "Which of my landing pages could get the most extra traffic, and what should I change?"

  • "Rewrite the title and meta description for /pricing based on the queries it ranks for."

  • "Why did organic traffic drop last month?"

  • "Are all the URLs in my sitemap indexed?"

  • "Which pages are competing with each other for the same keywords?"

It runs locally on your machine over stdio. Your Google credentials are stored on your computer and only sent to Google.

What it can do

Tool

What it does

performance_summary

Clicks, impressions, CTR and position versus the previous period or last year, with trend, top queries, top pages, devices and countries.

find_quick_wins

"Striking distance" queries (position 4-20 by default) ranked by the extra clicks you would get at the top, using your site's own CTR curve.

find_ctr_opportunities

Pages or queries that rank well but get fewer clicks than they should: title and meta description rewrite candidates, with the queries to target.

compare_periods

Biggest gains, losses, new and lost pages or queries between two periods. Good for traffic drops and content decay.

find_cannibalization

Queries where two or more of your pages split impressions.

analyze_page

Deep dive on one URL: performance, every query it ranks for, striking-distance terms, Google index status and a live on-page audit, including whether the top queries appear in the title, H1 and description.

audit_page

On-page audit of any public URL: status and redirects, title, meta description, headings, canonical, robots, hreflang, Open Graph, JSON-LD, word count, image alt text, links. No Search Console access needed.

inspect_urls

URL Inspection for a list of URLs or every URL in a sitemap: indexed or not, coverage state, last crawl, canonical chosen by Google, rich result issues.

search_analytics

Raw Search Analytics queries with any dimensions (query, page, country, device, date, hour, search appearance), filters and search types (web, image, video, news, Discover, Google News).

list_sites

Your Search Console properties.

list_sitemaps / submit_sitemap / delete_sitemap

Sitemap status and management. Submitting and deleting needs write access.

auth_status / login

Connection status and browser sign-in from inside Claude.

It also ships three prompts (slash commands in Claude Code, the "+" menu in Claude Desktop): seo_audit, optimize_page and investigate_traffic_drop.

Tools accept a property in any form: sc-domain:example.com, https://www.example.com/, or just example.com. Dates are Pacific Time like Search Console itself, and the default period is the last 28 days of final data.

Related MCP server: mcp-server-google-search-console

Setup

You need a Google account with access to at least one Search Console property, and Node.js 20 or later.

1. Create a Google OAuth client (one time, about 5 minutes)

Google requires every app that reads Search Console data to have its own OAuth client. You create one in your own Google Cloud project, so no third party ever sees your data or tokens.

  1. Open the Google Cloud Console and create a project (or pick an existing one), for example "Search Console MCP".

  2. Enable the Google Search Console API: APIs & Services > Library > Google Search Console API > Enable.

  3. Configure the consent screen under Google Auth Platform: pick External as the audience (or Internal if you use Google Workspace and only need your organization's accounts), give it a name and your email.

  4. Under Audience, click Publish app so it is "In production". In "Testing" mode Google expires your sign-in every 7 days. Since this app is only for you, you do not need Google's verification; you will see a "Google hasn't verified this app" screen when signing in, where you click Advanced > Go to (your app name).

  5. Under Clients, click Create client, choose Desktop app, and Download JSON.

2. Sign in

npx @portside-labs/gsc-mcp auth --client-secret-file ~/Downloads/client_secret_XXXX.apps.googleusercontent.com.json

Your browser opens for Google sign-in. Afterwards the command prints the properties you can access. Credentials are saved to ~/.config/gsc-mcp/credentials.json (%APPDATA%\gsc-mcp on Windows) with owner-only permissions.

By default the server gets read-only access. To let it submit and delete sitemaps, add --write.

3. Add it to Claude

Claude Code

claude mcp add gsc --scope user -- npx -y @portside-labs/gsc-mcp

Claude Desktop

Open Settings > Developer > Edit Config and add the server to claude_desktop_config.json:

{
  "mcpServers": {
    "gsc": {
      "command": "npx",
      "args": ["-y", "@portside-labs/gsc-mcp"]
    }
  }
}

Restart Claude Desktop. If it cannot find npx (common with nvm), use the full path from which npx as the command.

Alternatively, download the .mcpb bundle from the latest release and double-click it to install. Enter your OAuth client ID and secret in the settings dialog, then ask Claude to "sign in to Search Console".

Other MCP clients (Cursor, VS Code, Windsurf and so on): run npx -y @portside-labs/gsc-mcp as a stdio server.

Signing in from inside Claude

If you would rather not use a terminal, give the server your OAuth client through its environment and ask Claude to sign in. The login tool opens your browser and finishes the sign-in on its own:

{
  "mcpServers": {
    "gsc": {
      "command": "npx",
      "args": ["-y", "@portside-labs/gsc-mcp"],
      "env": {
        "GSC_OAUTH_CLIENT_ID": "1234-abc.apps.googleusercontent.com",
        "GSC_OAUTH_CLIENT_SECRET": "GOCSPX-..."
      }
    }
  }
}

Using a service account instead

Useful for automation, or for properties you do not own personally:

  1. In Google Cloud, create a service account and a JSON key, and enable the Search Console API in that project.

  2. In Search Console > Settings > Users and permissions, add the service account's email (...@....iam.gserviceaccount.com) as a user with Full or Restricted permission.

  3. Set GSC_SERVICE_ACCOUNT_KEY_FILE=/path/to/key.json in the server's environment.

Application Default Credentials work too when you opt in with GSC_AUTH=adc (the server ignores GOOGLE_APPLICATION_CREDENTIALS otherwise, since it is often set for unrelated projects). With gcloud, sign in with the Search Console scope and set a quota project:

gcloud auth application-default login --scopes=https://www.googleapis.com/auth/webmasters,https://www.googleapis.com/auth/cloud-platform
gcloud auth application-default set-quota-project YOUR_PROJECT_ID

Configuration

Variable

Purpose

GSC_DEFAULT_SITE

Property to use when a request does not name one, e.g. sc-domain:example.com.

GSC_MCP_READ_ONLY=1

Hide submit_sitemap and delete_sitemap and request only the read-only scope.

GSC_OAUTH_CLIENT_ID / GSC_OAUTH_CLIENT_SECRET

OAuth client for the login tool (alternative: GSC_OAUTH_CLIENT_FILE with the path to the downloaded JSON).

GSC_SERVICE_ACCOUNT_KEY_FILE

Use a service account key instead of OAuth.

GSC_AUTH=adc

Use Application Default Credentials (gcloud or GOOGLE_APPLICATION_CREDENTIALS).

GSC_MCP_HOME

Where credentials are stored. Default ~/.config/gsc-mcp. Use different values to run several Google accounts side by side.

GSC_MCP_CREDENTIALS

Full path of the credentials file, overriding GSC_MCP_HOME.

GSC_MCP_ALLOW_PRIVATE_URLS=1

Let audit_page fetch localhost and private network addresses, e.g. to audit a staging site. Off by default.

CLI

npx @portside-labs/gsc-mcp           # start the MCP server (what Claude runs)
npx @portside-labs/gsc-mcp auth      # sign in (add --write for sitemap changes, --no-browser to print the URL)
npx @portside-labs/gsc-mcp status    # show the connected account and its properties
npx @portside-labs/gsc-mcp logout    # revoke and delete saved credentials

How the opportunity scoring works

  • Expected CTR for each position comes from your own site: the median CTR of your queries at that rounded position. Positions with fewer than 8 queries of at least 20 impressions fall back to a conservative industry benchmark. Medians keep a few branded queries from distorting the curve. Every response shows the curve it used.

  • Quick wins estimate impressions × expected CTR at the target position − current clicks.

  • CTR opportunities flag rows whose CTR is below 70% of the expected CTR for their position, ranked by missed clicks.

  • Exclude your brand with excludeQueryRegex (RE2 syntax, e.g. (?i)acme|acme corp) for cleaner results.

Search Console hides rare "anonymized" queries, so query-level numbers add up to less than the property totals. The analysis tools read up to 25,000 rows per breakdown (one API request), sorted by clicks; on bigger properties they say so in a note and you can narrow with pageRegex or queryRegex.

Privacy and security

  • The server runs on your machine and talks only to Google's APIs and to the URLs you ask it to audit.

  • OAuth uses PKCE and a one-time listener on 127.0.0.1. The refresh token is stored in a file only your user can read. logout revokes it with Google.

  • audit_page, analyze_page and sitemap reading refuse localhost, private and link-local addresses (such as cloud metadata endpoints) unless you set GSC_MCP_ALLOW_PRIVATE_URLS=1. The check runs on the address actually connected to, on every redirect, so DNS rebinding cannot get around it.

  • Page content fetched for audits is untrusted. The server returns extracted fields (title, headings and so on), not the raw page.

Troubleshooting

Problem

Fix

"Your Google sign-in has expired or was revoked" every week

Your consent screen is in Testing mode. Publish it (setup step 4) and sign in again.

"The Google Search Console API is not enabled"

Enable it for the project your OAuth client belongs to (setup step 2).

access_denied during sign-in

Publish the app, or add your Google account as a test user under Audience.

No properties listed

The account has no verified properties, or you signed in with a different Google account. Check npx @portside-labs/gsc-mcp status.

"does not have sufficient access" for a property

Use the exact property from list_sites. Restricted users cannot see some data.

Sitemap submit fails with a scope error

Sign in again with auth --write (or the login tool with write: true).

Claude Desktop shows the server as failed

Check the logs in ~/Library/Logs/Claude/mcp-server-gsc.log (macOS) or %APPDATA%\Claude\logs (Windows). A missing npx on the PATH is the usual cause.

Development

npm install
npm run build        # compile to dist/
npm test             # unit and in-memory MCP integration tests
npm run typecheck
npm run pack:mcpb    # build the Claude Desktop bundle

Try a local build with the MCP Inspector: npx @modelcontextprotocol/inspector node dist/cli.js.

The tests run against an in-memory fake of the Search Console API (test/fakes.ts), so they need no Google account.

License

MIT © Portside Labs

Available Tools

15 tools
analyze_pageAnalyze one page for SEOA
Read-only

Deep dive on a single URL, such as a landing page: its search performance versus the previous period, every query it ranks for with position and CTR, striking-distance queries, Google's index status (URL Inspection), and a live on-page audit (title, meta description, headings, canonical, structured data) with a check of whether the top queries appear in the title, H1 and description. Use the result to rewrite titles and descriptions and to plan content changes.

Inputs: url (required), days, site, endDate, +5 more.

audit_pageOn-page SEO auditA
Read-only

Fetches a live URL and audits its HTML: status and redirects, title and meta description length, headings, canonical, robots directives, hreflang, Open Graph, JSON-LD types, word count, image alt text and links, with a list of issues. Works for any public URL and does not need Search Console access. Note it reads the raw HTML, so content rendered by JavaScript is not seen.

Inputs: url (required), targetQueries.

auth_statusSearch Console connection statusA
Read-only

Shows whether the server is signed in to Google Search Console, with which account and method, and whether it can make changes (sitemap submit/delete). Call this first if other tools report authentication problems.

Inputs: no named parameters.

compare_periodsCompare two periods (winners and losers)A
Read-only

Compares pages or queries between the current period and the previous period (or the same period last year) and lists the biggest declines, gains, new entries and lost entries. Use it to investigate traffic drops, find decaying content to refresh, and confirm the effect of changes.

Inputs: days, site, limit, device, +11 more.

delete_sitemapRemove a sitemapA
DestructiveIdempotent

Removes a sitemap from Search Console. This only stops Search Console tracking it; the file on the website is untouched and already-indexed URLs stay indexed. Requires write access. Confirm with the user before calling.

Inputs: sitemapUrl (required), site.

find_cannibalizationFind keyword cannibalizationA
Read-only

Finds queries where two or more of the site's pages compete for the same search, splitting impressions and often ranking each other down. For each query it lists the competing pages with their share of impressions and position. Typical fixes: consolidate or redirect the weaker page, differentiate intent, or adjust internal links and canonicals.

Inputs: days, site, limit, device, +10 more.

find_ctr_opportunitiesFind low-CTR pages or queriesA
Read-only

Finds pages (or queries) that rank well but get fewer clicks than expected for their position, compared with the site's own CTR-by-position curve. These are candidates for rewriting the title tag and meta description, or adding structured data for rich results. Each page comes with the queries it gets the most impressions for, so new titles can target them. Exclude branded queries with excludeQueryRegex for cleaner results.

Inputs: by, days, site, limit, +12 more.

find_quick_winsFind striking-distance keywordsA
Read-only

Finds "striking distance" queries: ones a page already ranks for just below the top results (position 4-20 by default) with meaningful impressions. Ranked by the extra clicks the page would get at the target position, using the site's own CTR-by-position curve. These are usually the fastest SEO wins: improve the ranking page's title, headings, content depth and internal links for the query.

Inputs: days, site, limit, device, +12 more.

inspect_urlsCheck Google index status (URL Inspection)A
Read-only

Checks how Google sees one or more URLs using the URL Inspection API: indexed or not, coverage state (e.g. "Crawled - currently not indexed"), last crawl, robots and noindex status, Google-selected versus declared canonical, and rich result issues. Pass urls, or sitemapUrl to check the URLs in a sitemap. Quota: 2,000 inspections per property per day, so keep batches focused. This reports the indexed version, not a live test.

Inputs: site, urls, limit, sitemapUrl, +1 more.

list_sitemapsList sitemapsA
Read-only

Lists the sitemaps submitted for a property with their status: last submitted and downloaded, whether processing is pending, error and warning counts, and how many URLs of each type they contain. Also checks the site's robots.txt and /sitemap.xml for sitemaps that exist but were never submitted.

Inputs: site.

list_sitesList Search Console propertiesA
Read-only

Lists the Search Console properties (sites) the signed-in account can access, with permission level. Domain properties look like "sc-domain:example.com"; URL-prefix properties look like "https://www.example.com/".

Inputs: no named parameters.

loginSign in to Google Search ConsoleA

Starts Google sign-in in the user's browser (OAuth with a local loopback redirect) and saves the credentials on this machine. Waits up to waitSeconds for the user to finish; if they need longer, it returns the sign-in URL and keeps listening for five minutes. Needs an OAuth client, either from an earlier gsc-mcp auth or the GSC_OAUTH_CLIENT_ID/GSC_OAUTH_CLIENT_SECRET environment variables.

Inputs: write, waitSeconds.

performance_summarySearch performance summaryA
Read-only

One-call overview of a property: total clicks, impressions, CTR and position versus the comparison period, the trend over time, top queries, top pages, device split and top countries. Good starting point for any SEO review.

Inputs: top, days, site, device, +9 more.

search_analyticsQuery Search AnalyticsA
Read-only

Raw Google Search performance data (clicks, impressions, CTR, average position) grouped by any dimensions, with filters. Use for custom questions the other tools do not answer, e.g. clicks by date for one page, queries containing a word, or country breakdowns. Rows are sorted by clicks (or by date when grouped by date). Final data lags 2-3 days; with dataState "all" the default range ends today and includes fresh, still-changing data.

Inputs: days, site, endDate, filters, +7 more.

submit_sitemapSubmit a sitemapA
Idempotent

Submits (or resubmits) a sitemap to Google Search Console so Google re-reads it. Resubmit after publishing or updating landing pages. Requires write access (sign in with write=true).

Inputs: sitemapUrl (required), site.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 15 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes, but analyze_page bundles search performance, URL Inspection and an on-page audit, overlapping with audit_page and inspect_urls. The descriptions do explain the difference (aggregate deep-dive vs. live HTML fetch vs. batch index status), so an agent can recover, but the boundaries are the weakest point in the set.

    Naming Consistency4/5

    Nearly all names follow a snake_case verb_noun pattern (list_sites, search_analytics, find_quick_wins, compare_periods, inspect_urls, submit_sitemap). A few deviate into noun/noun or adjective forms (auth_status, performance_summary) and login is a bare verb, but the style remains readable and consistent overall.

    Tool Count5/5

    15 tools is well within a sensible range and each one earns its place: auth, property listing, four analysis lenses, three page-level tools, and sitemap management. Nothing feels like filler or a duplicate of another tool.

    Completeness4/5

    Covers the full lifecycle for analytics, page diagnosis and sitemaps (list/submit/delete), with authentication handled explicitly. Minor gaps remain: no request-indexing action, no rich-results or Discover report, and no property add/remove (partly an API limitation).

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Connects Google Search Console to MCP clients to query search analytics, manage sitemaps, and perform URL inspections. It enables users to identify SEO opportunities and generate performance reports through natural language interactions.
      105 npm
      4
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables interaction with Google Search Console via MCP, offering search analytics, performance summaries, URL inspection, sitemap management, and property listing for SEO workflows.
      1,223 npm
      1
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Connects MCP clients to the Google Search Console API, enabling search analytics queries, URL inspection, sitemap management, and performance comparison across time periods.
      20
      45 PyPI
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables managing multiple Google Search Console accounts through a single MCP server, providing tools for search analytics, quick win detection, period comparison, URL inspection and indexing, and sitemap management.
      MIT