# GA4 SEO MCP [Health: Active]

**Category:** 🎯 Marketing  
**Repository:** https://github.com/GermaniU/ga4-seo-mcp  
**GitHub Stars:** 1  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/ga4-seo-mcp

## Description
Set up and audit site measurement: GA4, Search Console and PageSpeed. Read-only unless enabled.

## Tools
Capabilities this server exposes over MCP:

- **list_account_summaries** — List every GA4 account you can access, with a summary of its properties.

    Start here to find the account_id and property_id the other tools need.
    
- **list_properties** — List the GA4 properties under an account.

    Args:
        account_id: numeric account ID or 'accounts/123456789'.
        include_deleted: also return properties in the trash (soft-deleted, kept 35 days).
    
- **get_property** — Get the full settings of a GA4 property (time zone, currency, industry, type).
- **list_data_streams** — List the data streams (web, iOS, Android) of a GA4 property.

    Web streams include their measurement ID (G-XXXXXXX) and default URI.
    
- **get_data_stream** — Get one data stream, including the measurement ID of a web stream.
- **list_key_events** — List the key events (formerly conversions) declared on a GA4 property.
- **list_custom_dimensions** — List the custom dimensions declared on a GA4 property, with their scope.
- **list_google_ads_links** — List the links between a GA4 property and Google Ads accounts.
- **bootstrap_site_measurement** — Plan, and optionally apply, the full measurement setup of a website.

        With apply=False (default) nothing is changed: it detects what already exists for the
        site (GA4 property and web stream matched by the site's domain, key events, custom
        dimensions, Search Console domain property) and returns the steps that would run.
        Show this plan to the user and get explicit confirmation before calling apply=True.

        With apply=True (requires the server to run with --enable-writes) it creates only the
        missing pieces, skipping what exists, so it is safe to re-run. It returns a step-by-step
        report with the GA4 measurement ID (G-...) and the DNS TXT token for Search Console.
        DNS verification and sitemap submission stay manual follow-up steps
        (sc_verify_site_dns, sc_submit_sitemap) because the TXT record must be published first.

        Args:
            site_url: the site, e.g. 'https://example.com'.
            account_id: GA4 account that owns (or will own) the property; see
                list_account_summaries.
            property_display_name: name for a new property; also used to find an existing one.
            time_zone: IANA time zone for a new property, e.g. 'America/Mexico_City'.
            currency_code: ISO 4217 currency for a new property, e.g. 'USD'.
            key_events: event names to mark as key events, e.g. ['generate_lead'].
            custom_dimensions: parameters to register as custom dimensions.
            apply: False = plan only (default); True = execute the plan.
        
- **run_report** — Run a flexible GA4 report.

    Args:
        property_id: numeric ID or 'properties/123456789'.
        metrics: e.g. ['sessions', 'activeUsers', 'keyEvents']. Catalog:
            https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics
        dimensions: optional, e.g. ['date', 'sessionSource', 'pagePath']. Catalog:
            https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions
        date_start: 'YYYY-MM-DD', 'today', 'yesterday' or 'NdaysAgo' (e.g. '28daysAgo').
        date_end: same formats as date_start.
        limit: maximum rows (default 25).
        order_by_metric: sort by this metric, e.g. 'sessions'.
        order_desc: sort descending (default True).

    Returns the dimension and metric names, the date range, row_count and the rows.
    
- **run_realtime_report** — Realtime report for the last 30 minutes.

    Useful to confirm that a new event fires in production right after a deploy.

    Args:
        metrics: default ['activeUsers']; 'eventCount' also works.
        dimensions: default ['eventName']; also 'unifiedScreenName', 'country', 'deviceCategory'.
    
- **top_pages** — Top pages by sessions, with active users, bounce rate and average session duration.
- **events_summary** — Count of every event that fired, to audit what is actually being measured.

    Compare it with list_key_events to find key events that never fire.
    
- **traffic_sources** — Top traffic sources (source / medium) with sessions, active users and conversions.
- **conversions_summary** — Conversions and total users per event name: a summary of the active key events.
- **web_vitals_summary** — Core Web Vitals reported by your own site as GA4 events.

    Requires the site to send web-vitals events with the parameters `web_vital_metric` and
    `web_vital_rating`, both registered as event-scoped custom dimensions.
    For Google's field data use psi_field_data_only instead.
    
- **audit_portfolio** — Summary metrics for several GA4 properties in one call.

    Returns sessions, active users, conversions, bounce rate and average session duration per
    property, plus the properties that failed and why.

    Args:
        property_ids: e.g. ['123456789', '987654321'].
    
- **sc_list_sites** — List the Search Console sites you can access.

    Each entry has `siteUrl` ('sc-domain:example.com' for domain properties or a URL prefix
    like 'https://example.com/') and `permissionLevel` ('siteOwner', 'siteFullUser',
    'siteRestrictedUser' or 'siteUnverifiedUser').
    
- **sc_top_queries** — Top search queries with clicks, impressions, CTR (%) and average position.

    Args:
        site_url: 'sc-domain:example.com' or 'https://example.com/', exactly as in sc_list_sites.
        date_start: 'YYYY-MM-DD'.
        date_end: 'YYYY-MM-DD'. Search Console data lags 2-3 days.
        limit: rows to return (max 25000).
        country: optional ISO 3166-1 alpha-3 code to filter by, e.g. 'mex' or 'usa'.
    
- **sc_page_performance** — Top pages in Google Search by clicks, with impressions, CTR (%) and average position.
- **sc_query_breakdown_by_page** — Which search queries bring traffic to one specific page.

    Useful to decide which keywords to strengthen in that page's content.
    
- **sc_list_sitemaps** — List the sitemaps submitted for a Search Console site, with errors and warnings.
- **psi_audit** — Run a PageSpeed Insights audit (Lighthouse lab test + CrUX field data) on a public URL.

    Takes 30-90 seconds. Without PAGESPEED_API_KEY the anonymous quota is small and Google
    may answer 429; set the key for regular use.

    Args:
        url: absolute public URL, e.g. 'https://example.com/'.
        strategy: 'mobile' (default) or 'desktop'.
        categories: subset of ['performance', 'accessibility', 'best-practices', 'seo'].
            Default: all four.

    Returns 0-100 category scores, lab Core Web Vitals (LCP, FCP, CLS, TBT, SI, TTFB) and,
    when Chrome has enough real-user traffic, CrUX p75 field data for the URL and its origin.
    
- **psi_field_data_only** — Only the CrUX field data (real Chrome users, p75 over 28 days) for a URL and its origin.

    PageSpeed Insights still runs a performance-only Lighthouse pass, so expect 15-40 seconds.
    `overall_category` is FAST, AVERAGE or SLOW; it is null when the page has too little traffic.
    

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "ga4-seo-mcp": {
    "command": "uvx",
    "args": ["ga4-seo-mcp"]
  }
}
```

## Documentation

## What GA4 SEO MCP does

GA4 SEO MCP gives AI agents access to Google Analytics 4 administration and reporting, Google Search Console, and PageSpeed Insights. Its scope covers both ongoing analysis and the initial setup work required to measure a site. Agents can inspect GA4 accounts and properties, query traffic and event data, review Search Console performance, examine sitemaps, and run PageSpeed and CrUX checks.

The server also includes an end-to-end measurement workflow. `bootstrap_site_measurement` can find existing resources for a domain and produce a plan covering a GA4 property, web stream, key events, custom dimensions, and a Search Console domain property. Optional follow-up operations handle DNS verification and sitemap submission. Keyword research is available through DataForSEO and, with an extra package, Google Ads Keyword Planner.

## How it works

The server runs in Python and supports both stdio and Streamable HTTP MCP transports. The documented runtime requirement is Python 3.11 or newer. Clients launch it through `uvx`; the quick-start flow uses `uvx ga4-seo-mcp` after installing `uv` 0.13.4 or newer.

Toolsets control which functions are registered and which Google scopes are requested. The default groups are `admin`, `data`, `gsc`, and `psi`. Additional groups enable DataForSEO or Google Ads keyword research. The server can expose 24 tools with the defaults, 37 when writes are enabled, or 41 when every toolset is active with writes.

`bootstrap_site_measurement` is planning-only by default. With `apply=False`, it identifies existing resources and reports proposed creations without changing anything. With `apply=True`, it executes the plan only when write mode is enabled, skips resources that already exist, and returns a report containing the GA4 measurement ID and DNS TXT token. DNS publication remains a human-controlled step before verification and sitemap submission.

## Setup and configuration

Authenticate Google access with Application Default Credentials using a custom OAuth client or a service account. The `auth-command` command prints a `gcloud` login command with scopes matching the selected toolsets. GA4 and Search Console access uses Google Analytics and Webmaster scopes; write operations additionally require the relevant edit, Webmaster, and site-verification scopes.

A typical setup checks credentials before connecting an MCP client:

```bash
uvx ga4-seo-mcp doctor
claude mcp add ga4-seo -- uvx ga4-seo-mcp
```

Use `--toolsets` or `GA4SEO_TOOLSETS` to select tool groups. Enable writes with `--enable-writes` or `GA4SEO_ENABLE_WRITES=1`. PageSpeed does not require Google login, although `PAGESPEED_API_KEY` is recommended. DataForSEO uses `DATAFORSEO_LOGIN` and `DATAFORSEO_PASSWORD`; Google Ads keyword tools require installing the optional `ads` package.

## Tools and capabilities

- GA4 Admin operations for accounts, properties, web streams, key events, custom dimensions, Ads links, and measurement bootstrapping.
- GA4 Data API reports covering realtime data, top pages, events, traffic sources, and portfolio performance.
- Search Console queries, page data, sitemaps, domain registration, and DNS verification.
- PageSpeed Insights Lighthouse audits and CrUX field data.
- Optional DataForSEO keyword ideas and exact search volumes.
- Optional Google Ads Keyword Planner volumes, with bucketed results.
- Guided prompts for GA4 audits, SEO audits, portfolio digests, and site measurement launches.

## Limitations and notes

Write-capable tools are absent from the registry unless write mode is enabled, rather than merely blocked after registration. The default bootstrap operation only plans changes. DNS verification requires publishing the returned TXT record first, and sitemap submission remains an explicit follow-up action.

DataForSEO is a paid service. Google Ads keyword research requires the optional dependency and the `adwords` scope. Keyword research defaults to `es-MX`, with an override available. PageSpeed requests can run without Google authentication, but an API key is recommended. The server is intended to use minimum scopes for the selected toolsets, so enabling fewer groups reduces the requested access.

_Full upstream README: https://allmcps.com/mcp/ga4-seo-mcp/readme_

