Google Search Console MCP
Google Search Console MCP gives AI assistants live, allowlist-enforced access to Google Search Console APIs for reading search performance and managing indexing/sitemaps.
Read account/property info: test authentication, list sites, get site details and permission level.
Read search analytics: clicks, impressions, CTR, and position by query, page, country, device, date, or search type; also top queries and top pages over a lookback window.
Read sitemaps: list sitemaps submitted for a property.
Read indexing status: inspect a URL for index verdict, coverage, canonical, robots, and last crawl via the URL Inspection API.
Write to Google: submit or resubmit a sitemap, and request indexing for a new or updated URL via the Web Search Indexing API.
Enforce
GOOGLE_SEARCH_CONSOLE_SITE_URLSas an allowlist across every tool, including writes.Run through MCP clients like Claude Desktop or Claude Code, or test any tool from the terminal with
npm run call.Use only real Google API calls: no simulated tools, no cached results, and no disk writes unless
LOG_DIRis set.
Provides tools for interacting with Google Search Console, enabling search analytics (clicks, impressions, CTR, position), top queries and pages, sitemap listing/submission, URL inspection/index status, and indexing requests.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Google Search Console MCP What are my top queries from last month?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Google Search Console for your AI assistant
A Model Context Protocol server that lets Claude Desktop, Claude Code, or any MCP client ask Google Search Console real questions: which queries bring clicks, whether a page is indexed and why, which sitemaps Google has. Every tool is a live call to Google's API.
10 tools, 0 simulated. Search analytics, top queries and pages, URL Inspection, sitemaps, and Indexing API notifications. If Google's public API cannot do something, this server does not pretend to.
Writes are named as writes. 2 of the 10 tools change anything (
submit_sitemap,request_indexing), and their descriptions say so to the model.An allowlist that holds. Set
GOOGLE_SEARCH_CONSOLE_SITE_URLSand every tool, writes included, refuses any other property.Try it without a client.
npm run callruns any tool from your terminal through a real MCP client, the same path Claude uses.
The one idea worth stealing, even if you never run this code: put an AI tool's boundary in config the tool enforces, not in instructions the model is asked to follow. "Only touch example.com" in a prompt is a request.
GOOGLE_SEARCH_CONSOLE_SITE_URLS=sc-domain:example.comhere is a wall: a call for any other property fails before a request leaves the server.
60 seconds to a first answer
git clone https://github.com/andrewjpyle/google_search_console_mcp.git
cd google_search_console_mcp
npm install && npm run build
npm run call -- --list # no credentials needed: lists the 10 toolsAdd credentials (see Configuration), then ask a real question:
npm run call -- get_top_queries '{"site_url": "sc-domain:example.com", "days": 28, "limit": 8}'This is the real answer for andrewjpyle.com, trimmed:
{
"top_queries": [
{ "query": "mcp certification", "clicks": 2, "impressions": 44, "ctr": "4.55%", "position": "13.6" },
{ "query": "psiquantum roadmap", "clicks": 2, "impressions": 30, "ctr": "6.67%", "position": "6.1" },
{ "query": "best free ai", "clicks": 1, "impressions": 174, "ctr": "0.57%", "position": "4.9" }
],
"period": "28 days",
"rowCount": 8
}Related MCP server: mcp-server-gsc
Connect it to Claude
Claude Code
claude mcp add google-search-console \
-e GOOGLE_SEARCH_CONSOLE_CREDENTIALS="$(cat service-account.json | tr -d '\n')" \
-e GOOGLE_SEARCH_CONSOLE_SITE_URLS="sc-domain:example.com" \
-- node /absolute/path/to/google_search_console_mcp/dist/index.jsClaude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"google-search-console": {
"command": "node",
"args": ["/absolute/path/to/google_search_console_mcp/dist/index.js"],
"env": {
"GOOGLE_SEARCH_CONSOLE_CREDENTIALS": "{...service account json on one line...}",
"GOOGLE_SEARCH_CONSOLE_SITE_URLS": "sc-domain:example.com"
}
}
}
}Then ask things like "What were my top queries for example.com over the last 28 days?" or "Is https://example.com/pricing indexed, and if not, why?"
The tools
Tool | Type | What it does |
| read | Verify auth and count the properties the credentials can see |
| read | List the properties on the account |
| read | Permission level and details for one property |
| read | Clicks, impressions, CTR and position by query, page, country, device or date |
| read | Top queries over a lookback window |
| read | Top pages over a lookback window |
| read | Sitemaps submitted for a property |
| read | URL Inspection API: verdict, coverage, canonicals, robots, last crawl |
| write | Submit or resubmit a sitemap |
| write | Notify Google of a new or updated URL through the Web Search Indexing API |
How it works
Your MCP client starts the server and talks to it over stdio. Each call is validated with zod, checked against the allowlist, then sent to the Search Console API, the URL Inspection API or the Web Search Indexing API, with retry and backoff on rate limits and transient errors. The answer comes back as JSON the model can read.
Two hygiene rules a stdio server has to get right, and this one tests:
stdout is only for the protocol. Every log line goes to stderr. A test starts the server and fails if a single stdout line is not JSON-RPC.
Nothing on disk by default. File logs are written only when you set
LOG_DIR.
Stay in scope
The credentials behind these examples can see 106 Search Console properties. With
GOOGLE_SEARCH_CONSOLE_SITE_URLS=sc-domain:andrewjpyle.com, the server answered for exactly one,
and refused a submit_sitemap for anything else before any request reached Google.
Configuration
Credentials are read only from environment variables. Copy .env.example to .env, or pass them
from your MCP client's config.
Variable | Required | What it does |
| one auth method | Service-account JSON on one line. Add the service-account email as a user on each property. |
| one auth method | OAuth2 for a user's own Google account. |
| recommended | Comma-separated allowlist. When set, every tool refuses other properties. The first entry is the default when a call omits |
| no | Explicit default property. It must also be on the allowlist when one is set. |
| no |
|
| no | Write daily-rotated JSON logs here, kept 30 days. Unset means no files. |
Requires Node 20 or newer, a Google Cloud project with the Search Console API enabled, and credentials with access to the properties you want.
Scope: what it does not do
Google's public API covers only part of what the Search Console UI can do. Disavow files, hreflang settings, crawl rate, URL parameters, adding or removing properties, and URL removals have no public API, so they are not here, rather than shipped as fake tools. Google retired the crawl-errors API in 2019, so that is omitted too.
The patterns
Pattern | The failure it prevents |
Real API calls only | a tool that "succeeds" without doing anything |
Writes labeled in the tool description | a model that submits a sitemap thinking it is reading one |
Allowlist enforced in code | a prompt that says "only example.com" and a call that goes elsewhere |
stdout reserved for the protocol | a log line that breaks a strict MCP client mid-session |
No files unless asked | tool arguments quietly piling up in |
Say what the API cannot do | users trusting a disavow tool that never existed |
FAQ
Do I need Claude to try it? No. npm run call -- --list works with no credentials, and
npm run call -- <tool> '<json>' runs any tool through a real MCP client.
Can the model submit a sitemap for a site I did not intend? Not if you set
GOOGLE_SEARCH_CONSOLE_SITE_URLS. Without it, the credentials' own access is the only limit, so set it.
Why a service account? It is the easiest way to give a server read access to exactly the properties you add it to, with no browser sign-in. OAuth2 works too.
Does it cache or store results? No. Each call goes to Google. Nothing is written to disk unless
you set LOG_DIR.
Development
npm test # builds, then runs the jest suite (39 tests)
npm run dev # run from source with tsx
npm run call -- --listSecurity
Credentials come only from environment variables; nothing is hardcoded.
.env,*credentials*.jsonandlogs/are gitignored.Set
GOOGLE_SEARCH_CONSOLE_SITE_URLSto exactly the properties you want the assistant to reach. It is enforced for every tool, including the two writes.
Roadmap
A read-only mode that hides the two write tools entirely
A period-over-period comparison tool (this 28 days vs the previous 28)
Remote use over MCP's Streamable HTTP transport
License
MIT. By Andrew Pyle.
Available Tools
10 toolsget_indexing_statusA
Inspect a URL with the URL Inspection API (index status, coverage, canonical, richness)
Inputs: inspection_url (required), site_url.
get_site_infoA
Get details and permission level for a specific verified site
Inputs: site_url.
get_top_pagesA
Get the top performing pages for a site over a lookback window
Inputs: days, limit, site_url.
get_top_queriesC
Get the top search queries for a site over a lookback window
Inputs: days, limit, site_url.
list_sitemapsB
List all sitemaps submitted for a site
Inputs: site_url.
list_sitesA
List all verified sites in the authenticated Search Console account
Inputs: no named parameters.
request_indexingB
Notify Google of a new or updated URL via the Web Search Indexing API — a real write operation
Inputs: url (required), site_url.
search_analyticsB
Query Search Analytics data (clicks, impressions, CTR, position) by dimension
Inputs: end_date, site_url, row_limit, dimensions, +2 more.
submit_sitemapA
Submit (or resubmit) a sitemap to Search Console — a real write operation
Inputs: sitemap_url (required), site_url.
test_connectionB
Test connection and authentication to the Google Search Console API
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Most tools have clearly distinct purposes, but get_top_queries and get_top_pages overlap heavily with search_analytics since they are likely convenience wrappers around the same Analytics API. Agents could misselect between these, though descriptions help clarify the intent.
Tool names mostly follow a consistent verb_noun pattern like list_sites, get_site_info, submit_sitemap. The main deviation is search_analytics, which is a noun phrase rather than get_ or list_ style, creating a minor inconsistency.
10 tools is well-scoped for a Google Search Console MCP server. Each tool covers a meaningful area of the API—sites, search analytics, indexing, sitemaps, and connection testing—without unnecessary bloat or redundancy.
The tool set covers the primary Search Console workflows: site verification inspection, analytics queries, sitemap management, and indexing requests. Minor gaps exist such as no delete/remove sitemap or explicit URL removal tool, but these are not core workflows for most users.
Maintenance
Related MCP Connectors
Google Search Console for AI assistants: traffic, rankings, indexing and page checks. Read-only.
Read-only Google Search Console and Google Analytics for AI agents.
Google Search Console, Bing, Yandex and IndexNow for AI assistants, with live SEO analyses.
Google Search Console in your AI: overview, opportunities, index gaps, page checks, long history.
Related MCP Servers
- AlicenseAqualityDmaintenanceConnects AI assistants to Google Search Console data for SEO analysis, including search analytics, URL inspection, sitemaps, indexing, and opportunity detection.17MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to query and manage Google Search Console data, including search analytics, URL indexing status, and sitemap management, for SEO and LLMO analysis directly from a conversation.156,908 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to access Google Search Console search performance and index health data, including clicks, impressions, rankings, URL inspection, and sitemap management.16 npmMIT
- AlicenseAqualityDmaintenanceEnables AI assistants to analyze Google Search Console SEO data through natural language, including search analytics, URL inspection, sitemap management, and property management.21MIT