← Back to directory
G

Google Analytics 4 MCP Server

Community
Query and analyze GA4 data through AI assistants.
Category
Other #320 of 678
Stars
★ 242 Popular
Transport
stdio (local process)
Runtime
Python
Credentials
API key / credential required
License
MIT
Last commit
Tools
12
52FMRS · D

This stdio server provides GA4 queries, schema discovery, and analytical assistance. It requires service account credentials and a property ID; the README states that telemetry is enabled by default.

Strongest · Documentation 13/20 Weakest · Reliability 8/20

Reliability
8/20
Security and permissions
10/20
Maintenance
9/20
Documentation
13/20
Setup experience
12/20
Why each score
Reliability 8/20
The README lists GA4 query, schema discovery, aggregation, and troubleshooting tools, and identifies the required credentials and property ID, so the normal service path appears plausible. The supplied material contains no CI workflow contents, committed tests, initialization-handshake evidence, or error-handling details. Telemetry behavior also cannot be verified from its description, so the static-review evidence warrants deductions.
Security and permissions 10/20
The manifest requires service-account credentials and marks them secret. The README says telemetry is enabled by default, describes tool and environment metadata it sends, discloses that query intent and dimension and metric names are sent, and provides opt-out settings. These disclosures help, but the implementation of data flows and external skill loading cannot be checked from the supplied material, and permission scope or confirmation for sensitive operations is not shown. No red-line evidence is present.
Maintenance 9/20
The material shows an MIT license, version 2.12.6, an update-check tool, and an unarchived repository, indicating a version and update path. It provides no commit history, release cadence, issue-response evidence, or security contact channel. Stars do not contribute to this score.
Documentation 13/20
The README provides several client configuration examples, installation commands, a tool-parameter overview, telemetry disclosures, skill examples, and troubleshooting tools, and identifies the required credentials and property ID. The material does not explain quotas, costs, specific data limits, or complete permission setup. The telemetry and dynamic-skill implementations also cannot be verified.
Setup experience 12/20
The README gives a one-line installer and uvx, Python, and npx launch options, with client examples for Claude, Cursor, and VS Code; the manifest specifies stdio transport and required environment variables. Setup still requires Google service-account credentials and GA4 property access. There is no verifiable CI or key-path test evidence, so the static calibration limits the score.

Static review · not runReviewed 2026-11-29

Read the FMRS scoring method →

Fit and risk

What it can accessReads local filesUses the network

Best for

  • Analysts and teams that need to query GA4 properties through AI assistants.
  • Workflows that benefit from GA4 schema discovery and server-side aggregation.

Not for

  • Users without access to a GA4 property or Google Cloud service account credentials.
  • Workflows that need to query data sources other than Google Analytics.

Required permissions

  • Requires a Google Cloud service account JSON key with access to the target GA4 property, along with its numeric property ID.

Risks and side effects

  • The README says telemetry is on by default. Boot and tool events send some configuration, tool execution details, and error categories. Calls to get_ga4_data also send the intent and dimension and metric names; search_skills sends its query.
  • An incorrect property ID, credential file, or access grant can prevent setup or queries from succeeding.

Setup

Before you start

Runtime:Python

GOOGLE_APPLICATION_CREDENTIALS requiredsecret Set this to the absolute path of a Google Cloud service account JSON key with GA4 property access; obtain the key from Google Cloud.
GA4_PROPERTY_ID required Set this to the numeric GA4 property ID to query; find it in Google Analytics property settings.
Other optional settings (4)
DO_NOT_TRACK optional Set to `1` to disable telemetry before startup.
DISABLE_TELEMETRY optional Set to `1` to disable telemetry before startup.
NO_TELEMETRY optional Set to `1` to disable telemetry before startup.
GA_MCP_TELEMETRY optional Set to `false` to disable telemetry before startup.

Configure the MCP client to run command uvx with argument google-analytics-mcp, and set GA4_PROPERTY_ID and GOOGLE_APPLICATION_CREDENTIALS in its environment. The README also provides examples for Claude Code, Cursor, Google Antigravity, and VS Code clients.

claude_desktop_config.json
{"mcpServers":{"google-analytics":{"command":"uvx","args":["google-analytics-mcp"],"env":{"GA4_PROPERTY_ID":"your_ga4_property_id","GOOGLE_APPLICATION_CREDENTIALS":"/path/to/service_account.json"}}}}

Shown for Claude Desktop. Other clients may use a different file or key (VS Code uses "servers") — the configurator below converts it.

.vscode/mcp.json
{
  "servers": {
    "google-analytics": {
      "command": "uvx",
      "args": [
        "google-analytics-mcp"
      ],
      "env": {
        "GA4_PROPERTY_ID": "your_ga4_property_id",
        "GOOGLE_APPLICATION_CREDENTIALS": "/path/to/service_account.json"
      }
    }
  }
}

Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).

~/.codex/config.toml
[mcp_servers.google-analytics]
command = "uvx"
args = ["google-analytics-mcp"]

[mcp_servers.google-analytics.env]
GA4_PROPERTY_ID = "your_ga4_property_id"
GOOGLE_APPLICATION_CREDENTIALS = "/path/to/service_account.json"

Append to ~/.codex/config.toml (OpenAI Codex CLI uses TOML).

Terminal
claude mcp add google-analytics -e GA4_PROPERTY_ID=your_ga4_property_id -e GOOGLE_APPLICATION_CREDENTIALS=/path/to/service_account.json -- uvx google-analytics-mcp

Run it in a terminal; replace any <…> placeholders with your own values first.

Check that it works

Confirm that `get_ga4_data` and `search_schema` appear in your client’s tool list. Call `list_properties` and check that it returns GA4 property information to verify the connection.

Troubleshooting

  1. Check that GA4_PROPERTY_ID is the numeric property ID.
  2. Check that GOOGLE_APPLICATION_CREDENTIALS points to a service account JSON key and that the account has access to the target property.
  3. Use get_troubleshooting_guide for setup, IAM/403, or schema errors.

Things to try

Once connected, you can ask your AI assistant things like:

  • Show sessions and total users for the last 7 days.
  • List the available GA4 properties.
  • Search for dimensions and metrics related to traffic sources.

Tools 12

get_ga4_data read-only
Runs multidimensional GA4 reports with metric totals and server-side aggregation.
list_properties read-only
Lists GA4 properties; returns the configured property when GA4_PROPERTY_ID is set.
search_schema read-only
Ranks relevant dimensions and metrics for a keyword, returning up to 10 results.
get_property_schema read-only
Returns the full dimension and metric schema for the configured property.
list_dimension_categories read-only
Lists dimension categories and their counts.
list_metric_categories read-only
Lists metric categories and their counts.
get_dimensions_by_category read-only
Returns dimensions in a category with API names and descriptions.
get_metrics_by_category read-only
Returns metrics in a category with API names and descriptions.
Show 4 more tools
search_skills read-only
Fetches analytical recipes and guides for traffic diagnosis, attribution, ecommerce, AI referrals, and bot detection.
get_troubleshooting_guide read-only
Provides a troubleshooting guide for setup, IAM/403, or schema errors.
setup_ga4_access writes
Interactively fixes property ID, credentials, or access issues and reinitializes the server.
check_for_updates read-only
Checks PyPI for a newer release and provides upgrade instructions.

Use cases

Query and aggregate GA4 reports on website traffic and user behavior.
Find relevant GA4 dimensions and metrics before requesting a report.
Analyze traffic changes, channel attribution, ecommerce performance, or AI referral traffic.

Supported clients

Claude Desktop
Cursor
Antigravity
Claude CodePartial support
ClinePartial support
Roo CodePartial support
ContinuePartial support

Listed from the project's documentation, not tested by this site.

Overview

This MCP server connects AI assistants to Google Analytics 4 data about website traffic, user behavior, and performance. It offers report queries, dimension and metric discovery, server-side aggregation, and analytical guides.

Similar servers

Source revision ebabee7c3db7 Data synced 2026-12-05 Read the FMRS scoring method Markdown

Maintainer badge: embed FMRS score

Paste this Markdown into your repository README to display a live score badge:

README.md
[![FollowMCP](https://followmcp.com/badges/surendranb-google-analytics-mcp.svg)](https://followmcp.com/en/servers/surendranb-google-analytics-mcp)