Google Search Console MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| GOOGLE_SEARCH_CONSOLE_API_BASE | No | API root override. | https://searchconsole.googleapis.com |
| GOOGLE_SEARCH_CONSOLE_CLIENT_ID | No | OAuth2 client id (refresh flow). | |
| GOOGLE_SEARCH_CONSOLE_TIMEOUT_MS | No | Per-request timeout, ms. | 60000 |
| GOOGLE_SEARCH_CONSOLE_MAX_RETRIES | No | Retries on transient errors. | 3 |
| GOOGLE_SEARCH_CONSOLE_ACCESS_TOKEN | No | Alternative: a static access token (~1 h lifetime), mostly for testing. | |
| GOOGLE_SEARCH_CONSOLE_CLIENT_SECRET | No | OAuth2 client secret (refresh flow). | |
| GOOGLE_SEARCH_CONSOLE_REFRESH_TOKEN | No | OAuth2 refresh token (refresh flow). |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Google Search Console reports how a property performs in organic Google Search and how its URLs stand in the index — not Google Analytics (on-site traffic), not Google Ads. Nothing here can request (re)indexing; a sitemap submission is the only nudge, and writes are limited to linking/unlinking a property and submitting/removing sitemaps. Batch work is where it bites: 2,000 URL inspections per property a day and 200 sites/sitemaps calls a minute — never sweep a whole site; 429s and read-side 5xx are already retried inside the server, so a returned error is final. Take property ids verbatim from list_sites: a 403/404 is usually a near-miss id (scheme, www, trailing slash, sc-domain:), not a permissions problem; a 403 on a write points at a readonly token; auth failing on every call means a dead refresh token (they expire after 7 days while the OAuth consent screen is in Testing). Empty rows[] on the first page usually means the dates fall in the 2-3 day finalization lag or you queried a sibling property, not zero traffic. Confirm with the user before delete_site or delete_sitemap.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| auth_statusA | Shows whether this server is connected to Google: token presence and source (env variables or a stored in-chat login), expiry, the Google account email, granted vs missing OAuth scopes, where the credentials file lives and where the OAuth client comes from. Makes no network calls and never returns the token itself. Call it first when other tools report the server is not connected. |
| setup_instructionsA | This server ships with a built-in OAuth client, so connecting normally needs only start_login + finish_login; call this for the details or to switch to your own client. The checklist adapts to the client in use: with the built-in client it is just the two login calls, and it adds the steps for your OWN client — creating a Google Cloud project and a Desktop-app OAuth client, publishing the consent screen (mandatory — Testing-mode refresh tokens die after 7 days), downloading the client JSON and handing its PATH to set_client. Works without any credentials; with your own client already configured it shortens to 'enable the API + log in' (one client serves the whole mcp-google-* line). Never asks the user to paste secrets into the chat. |
| set_clientA | Saves the OAuth client credentials from the JSON file downloaded from Google Cloud Console ('Download JSON' on a Desktop-app client). Pass the file PATH — the secret must never be pasted into the chat. The client is stored once in the shared ~/.config/mcp-google-auth/client.json (owner-only) and reused by every mcp-google-* server; tokens stay per-server. After this, call start_login. |
| start_loginA | First step of connecting from the chat, without editing config files or restarting the client. Returns authorizeUrl — show it to the user as a clickable link and ask them to open it in the browser ON THIS MACHINE, pick the Google account and approve access. A one-shot listener on 127.0.0.1 catches Google's redirect; the code is exchanged locally and never passes through the chat. Does not open the browser itself. The attempt lives 10 minutes; when the browser shows the success page, call finish_login. |
| finish_loginA | Second step: waits up to 20 s for the browser consent to finish, saves the tokens to an owner-only file and verifies the login with a read-only identity call, returning the account email and the granted scopes. After success every tool works immediately — no client restart. If the user granted only part of the requested permissions, the login is still saved and missingScopes lists what will not work. Logging in under a different Google account replaces the previous login (its refresh token is revoked best-effort) and the response carries previousAccountEmail so the change never goes unnoticed. |
| logoutA | Revokes the stored token at Google (oauth2.googleapis.com/revoke) and deletes the local credentials file. Tokens supplied via env variables are NOT touched — remove them from the MCP client config manually; envTokenStillSet in the response says whether any are still in effect. |
| list_sitesA | Lists every Search Console property the authenticated account can access. Returns { siteEntry: [{ siteUrl, permissionLevel }] } where siteUrl is either a URL-prefix property ("https://example.com/") or a domain property ("sc-domain:example.com"), and permissionLevel is siteOwner, siteFullUser, siteRestrictedUser or siteUnverifiedUser. Call this FIRST: every other tool needs the siteUrl exactly as returned here — a near-match (missing trailing slash, wrong scheme, www vs non-www) is a different property and returns 403/404. |
| get_siteA | Returns one property's entry: { siteUrl, permissionLevel }. A 404 means the value does not match any registered property — check the exact format (trailing slash, scheme, sc-domain: prefix) against list_sites output. |
| add_siteA | Adds a property to the account's Search Console set. The property starts UNVERIFIED (permissionLevel siteUnverifiedUser) and most data calls will return 403 until it is verified — verification happens through the Search Console UI or the separate Site Verification API, not through this API. Success is an empty API response (surfaced as { ok: true, added }). Requires the full webmasters OAuth scope (the readonly scope cannot mutate). |
| delete_siteA | Removes (unlinks) a property from the account's Search Console set. No data is deleted and other owners keep their access — this only removes the property from THIS account's list; it can be re-added later. Success is an empty API response (surfaced as { ok: true, removed }). Requires the full webmasters OAuth scope. |
| list_sitemapsA | Lists the sitemaps submitted for a property (or, with sitemap_index, the children of a sitemap index file). Returns { sitemap: [WmxSitemap] } with per-sitemap path, lastSubmitted, lastDownloaded, isPending, isSitemapsIndex, type (sitemap/rssFeed/atomFeed/patternSitemap/urlList/notSitemap), warnings and errors counts, and contents[] with per-content-type submitted counts. The contents[].indexed field is deprecated and returns nothing useful — never present it as indexed pages. |
| get_sitemapA | Returns one submitted sitemap's details (the same WmxSitemap shape as list_sitemaps): errors/warnings counts, isPending, lastSubmitted/lastDownloaded, and per-content-type submitted counts. Useful to check processing status after submit_sitemap. |
| submit_sitemapA | Submits (or resubmits) a sitemap for the property. The feedpath must be the sitemap's full URL on the property. Success is an EMPTY API response (surfaced as { ok: true, submitted }); processing is asynchronous — check errors/warnings later with get_sitemap. Requires the full webmasters OAuth scope (readonly is not enough). |
| delete_sitemapA | Removes a sitemap from Search Console. This does not delete the file from the site, and Google may still discover it via robots.txt — it only removes the submission. Success is an empty API response (surfaced as { ok: true, deleted }). Requires the full webmasters OAuth scope. |
| search_analyticsA | Runs a Search Analytics (performance) query for a property: clicks, impressions, CTR and average position from Google Search, grouped by the requested dimensions. Each returned row has keys[] (one value per requested dimension, in the same order) plus clicks, impressions, ctr (a FRACTION 0..1, not a percent) and position; rows are sorted by clicks descending. With no dimensions you get one totals row for the range. Dates are calendar dates in Pacific Time and end_date is INCLUSIVE; final data lags ~2-3 days behind (use data_state "all" for fresh, still-changing rows). Pagination: there is no page token — repeat with start_row increased by row_limit until a response comes back with no rows. When grouping by query/page some anonymized long-tail data is never returned, so summed rows will not match a dimensionless totals query. Quota: 1,200 queries/minute per site and per user. |
| get_top_queriesA | Convenience wrapper over search_analytics for the most common ask: the top search queries for a property, sorted by clicks descending (the API's default order). Each row has keys[0] = the query string plus clicks, impressions, ctr (a FRACTION 0..1) and position. Dates are calendar dates in Pacific Time, end_date inclusive; final data lags ~2-3 days. Anonymized long-tail queries are never returned. Same endpoint and quota as search_analytics — use search_analytics directly for other dimensions, pagination, fresh data or regex filters. |
| inspect_urlA | Inspects a URL's status in the Google index (URL Inspection API). Returns { inspectionResult } with: inspectionResultLink (the Search Console UI page for this inspection); indexStatusResult — verdict (PASS/PARTIAL/FAIL/NEUTRAL), human-readable coverageState (e.g. "Submitted and indexed"), robotsTxtState (ALLOWED/DISALLOWED), indexingState, lastCrawlTime, pageFetchState (SUCCESSFUL/SOFT_404/NOT_FOUND/SERVER_ERROR/...), googleCanonical vs userCanonical, sitemap[], referringUrls[], crawledAs (DESKTOP/MOBILE); plus ampResult and richResultsResult (with per-item issues and severities) when applicable. Only the status of the version already in the Google index is returned — this is NOT a live test. mobileUsabilityResult may still appear in responses but the product is retired — ignore it. QUOTA WARNING: only 2,000 inspections per property per DAY (and 600/minute) — throttle any batch inspection and expect 429/403 rateLimitExceeded beyond that. |
| raw_requestA | Escape hatch to call any Google Search Console API path directly, for requests the typed tools don't cover. Two surfaces share the host: "webmasters/v3/..." (sites, sitemaps, searchAnalytics) and "v1/..." (urlInspection). siteUrl and feedpath are PATH SEGMENTS and must be URL-encoded (encodeURIComponent), e.g. "webmasters/v3/sites/sc-domain%3Aexample.com/sitemaps". The path may carry a query string. The Bearer token is added automatically; the method defaults to GET. Note: sites.add and sitemaps.submit are PUT with no body and return an empty response on success. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 18 tools
The resource-oriented tools (sites, sitemaps, analytics, inspection) are cleanly separated with no real ambiguity. The only overlaps are the deliberately documented ones: get_top_queries is an explicit convenience wrapper over search_analytics, and the auth group (start_login/finish_login/set_client/auth_status/setup_instructions) is a multi-step flow whose boundaries are spelled out in each description. Six auth tools is a lot of surface, but each step is distinguishable.
Nearly everything follows verb_noun snake_case (list_sites, get_site, add_site, delete_site, submit_sitemap, inspect_url, search_analytics). Minor deviations exist: logout has no object, auth_status is noun-first, and raw_request/start_login are verb-first but not object-scoped. Still highly readable and predictable overall.
18 tools is slightly heavy but each maps to a real operation in the Search Console API, and the domain (properties + sitemaps + analytics + URL inspection) justifies a surface this size. A third of the tools are OAuth plumbing, which is arguably more than needed but is a genuine lifecycle rather than filler.
Full lifecycle coverage for sites (list/get/add/delete) and sitemaps (list/get/submit/delete), the core analytics query plus a top-queries shortcut, and URL inspection are all present, with raw_request as an escape hatch for uncovered paths. Gaps are minor and documented: no site-verification tool (explicitly out of the API's scope) and no batch inspection helper, so bulk work must be throttled by the agent.