ga4-gsc-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| BRAND_TERMS | No | Comma-separated brand terms, e.g. `acme,acme widgets,acmee`. Used by `top_queries` and `quick_wins` when `brand` is specified. | |
| GSC_SITE_URL | No | Default Search Console site, e.g. `sc-domain:example.com`. | |
| GA4_PROPERTY_ID | No | Default GA4 property, so you can leave `ga4_property` out. | |
| GA4_GSC_MCP_DEMO | No | Set to `1` to use built-in fake data for example.com; no network calls at all. | |
| PAGESPEED_API_KEY | No | Google API key with the PageSpeed Insights API enabled, for a higher `page_speed` quota (works without one at low volume). | |
| BING_WEBMASTER_API_KEY | No | Bing Webmaster Tools API key. Adds the nine `bing_` tools. | |
| GA4_GSC_MCP_CONFIG_DIR | No | Where `auth` saves the refresh token (default `~/.config/ga4-gsc-mcp`). | |
| GOOGLE_APPLICATION_CREDENTIALS | No | Path to a service account key or other ADC JSON file. The server uses this first if set; otherwise it falls back to a login saved by `npx ga4-gsc-mcp auth` or gcloud Application Default Credentials. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Reads Google Analytics 4 (GA4), Google Search Console (GSC) and, when configured, Bing Webmaster Tools with local, read-only credentials. Pick one tool per question: general performance -> site_overview; searches -> top_queries; pages -> top_pages; what to improve -> quick_wins; why traffic fell -> why_did_it_drop; every page or query that lost traffic -> traffic_drops; which platform dropped -> channel_changes; where visitors come from -> traffic_sources; conversions by channel -> attribution; visits from ChatGPT and other assistants -> ai_traffic; anything else -> run_ga4_report or search_console_query; indexing -> inspect_url or inspect_urls; speed -> page_speed; Bing -> the bing_ tools. Pass the site as the user named it. Call list_properties only when the site is unclear. Quote the numbers the tools return and always mention the date range and source from receipt.summary. Search Console data lags 2 to 3 days, so ranges end on the last settled day.
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 |
|---|---|
| list_propertiesA | Which GA4 properties and Search Console sites can these credentials see? Returns property IDs and site URLs to use with the other tools. |
| site_overviewA | How is my site doing? GA4 sessions, users, key events and engagement plus Search Console clicks, impressions, CTR and average position, each with change against the previous period or last year. |
| top_queriesA | Which Google searches bring clicks? Top Search Console queries with impressions, CTR, position and change. Filter by page, text, or brand vs non-brand. JSON or CSV. |
| top_pagesA | Which pages get the most search clicks and visits? Search Console pages joined with GA4 landing-page sessions, key events and engagement. |
| quick_winsA | What should I improve first? Queries ranking 4 to 20 with real impressions and low CTR, ranked by extra clicks from a top-3 spot, plus the site's CTR by position against a benchmark. |
| traffic_dropsA | What lost traffic? Pages or queries that lost the most Search Console clicks (or GA4 landing-page sessions) against the previous period or last year, worst first, with position change. |
| ai_trafficA | How many visits come from ChatGPT, Perplexity, Claude, Gemini and Copilot? GA4 sessions from AI assistant referrers by assistant, share of all sessions, engagement and top landing pages. |
| run_ga4_reportA | Any GA4 question the other tools do not cover: a raw Google Analytics Data API runReport with your own dimensions, metrics, filters and order (API names, e.g. sessionDefaultChannelGroup, sessions). |
| search_console_queryB | Any Search Console question: raw searchanalytics.query by query, page, country, device, date or searchAppearance, with filters, search type (web, image, video, news, Discover) and paging. |
| inspect_urlA | Is this page indexed by Google? Search Console URL Inspection: index verdict, coverage, last crawl, canonical, robots.txt and mobile usability. |
| why_did_it_dropB | Why did Google traffic drop? Clicks change split into impressions and CTR, start date, cause per page and query, index status, and Google ranking updates in the window. |
| find_cannibalizationA | Which queries are split between two or more of my pages? Search Console queries where a second page takes a real share of impressions, with the page to keep. |
| content_decayA | Which pages are slowly losing Google clicks? Pages whose clicks fell steadily over the last 3 complete months against the 3 before, with monthly clicks and position. |
| top_moversA | What changed most? Queries and pages that gained or lost the most Search Console clicks, plus GA4 landing pages by sessions: week on week, month on month or year on year. |
| find_anomaliesA | Were there unusual days? Spikes and dips in daily Search Console clicks and GA4 sessions against the normal range, plus the day a lasting drop began. |
| ai_overview_suspectsA | Which searches might an AI Overview be taking clicks from? Queries with more impressions, a much lower CTR and a steady position, ranked by clicks lost. |
| inspect_urlsA | Are these pages indexed? Search Console URL Inspection for up to 20 URLs or paths at once, not indexed first, with canonical mismatches flagged. |
| sitemapsA | Which sitemaps has Google got for my site? Submitted sitemaps with last read date, URL counts, errors and warnings. Read only. |
| page_speedA | How fast is this page? PageSpeed Insights: Core Web Vitals from real visitors (LCP, INP, CLS), Lighthouse score and the top fixes. Sends only the URL to Google. |
| traffic_sourcesB | Where do my visitors come from? GA4 sessions by channel, source / medium, source, campaign, country, device or landing page, with change, engagement, key events and bot or spam flags. |
| channel_changesA | Which platform sent fewer visitors? GA4 sessions by platform (Google, Bing, each AI assistant, social, email, direct, paid), worst change first, cross-checked with Search Console and Bing. |
| attributionB | Which channels bring conversions and revenue? GA4 key events and revenue by channel, source / medium or campaign, in session or first-user scope, with change. |
| ga4_funnelA | Where do visitors drop off before a goal? A GA4 funnel of 2 to 10 steps (event names or page paths): users per step, completion and abandonment. Beta: uses Google's v1alpha API. |
| run_ga4_realtime_reportA | Who is on my site right now? GA4 realtime report for the last 30 minutes: active users by country, page, device, event or source. |
| ga4_metadataA | Which dimensions and metrics can I use? GA4 metadata for a property, including custom dimensions and metrics, searchable by name or category. |
| run_ga4_batch_reportsA | Several GA4 reports in one call (up to 5) over the same dates, e.g. sessions by country, by device and by channel together. |
| run_ga4_pivot_reportC | A GA4 pivot table, e.g. sessions by channel down the side and device across the top (Data API runPivotReport). |
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 27 tools
The question-style descriptions genuinely help, but several clusters overlap: traffic_sources / attribution / channel_changes all break GA4 sessions down by channel-ish dimensions, and top_movers / traffic_drops / find_anomalies / why_did_it_drop all answer 'what changed'. Raw escape hatches (run_ga4_report, search_console_query) also shadow many of the curated tools, so an agent must read carefully to pick the right one, and ai_traffic duplicates part of channel_changes.
Two conventions coexist: verb_noun imperatives (list_properties, inspect_url, find_anomalies, find_cannibalization) and bare noun phrases (site_overview, top_queries, content_decay, page_speed). The raw API tools do form a predictable run_ga4_* family, and inspect_url vs inspect_urls is a clear single/batch pair, but the overall surface mixes styles and includes question-flavored names unlike anything else.
27 tools is heavy and crosses into the crowded range; the curated insight tools (quick_wins, ai_overview_suspects, content_decay, traffic_drops) could partly be parameterized instead of being separate endpoints. The breadth is defensible given two products plus PageSpeed plus four GA4 API dialects, but the count sits at the upper edge of what an agent can scan reliably.
Coverage is strong: raw report/query tools for both GA4 and Search Console, metadata discovery, realtime, batch, pivot, funnels, URL inspection (single and batch), sitemaps and page speed, so almost any read-only analytics question has a path. Gaps are minor and mostly write-side or specialized (sitemap submission, annotations, cohort/audience reports), which are not reachable even via the raw escape hatches.