Google Analytics

Google Analytics

Google Analytics MCP Server to bring data across 200+ dimensions & metrics for LLMs to analyse.

156
Stars
31
Forks
1
Releases

Overview

Google Analytics MCP Server connects Google Analytics 4 data to MCP clients such as Claude and Cursor, enabling natural language querying over 200+ GA4 dimensions and metrics. It supports GA4 property access via a service account and provides built-in safeguards to manage data volume, including automatic row estimation, warnings when results would exceed 2,500 rows, and optimization suggestions. The server performs server-side processing with intelligent aggregation, smart sorting, and efficient filtering to improve response quality and prevent context-window crashes. A set of discovery and reporting tools is exposed, including search_schema, get_ga4_data, list_dimension_categories, list_metric_categories, get_dimensions_by_category, get_metrics_by_category, and get_property_schema. The MCP can be deployed via pip or by downloading from GitHub, with a configurable MCP JSON specifying command, arguments, and environment variables like GA4_PROPERTY_ID and GOOGLE_APPLICATION_CREDENTIALS. The project includes a ga4_mcp module with server, coordinator, and tools for data reporting and metadata. The MCP targets users who want to analyze website traffic, user behavior, and e-commerce metrics using natural language queries across GA4 data.

Details

Owner
surendranb
Language
Python
License
Updated
2025-12-07

Features

Smart Data Volume Management

Automatic row estimation, interactive warnings for large results, and optimization suggestions to reduce data volume.

Server-Side Processing & Optimized Queries

Intelligent aggregation, smart sorting, and efficient filtering to deliver relevant results while reducing context window strain.

User Control Parameters for Query Safety

Parameters like limit, proceed_with_large_dataset, enable_aggregation, and estimate_only provide fine-grained control over results.

Built-in Discovery & Data Retrieval Tools

Tools such as search_schema, get_ga4_data, list_dimension_categories, list_metric_categories, get_dimensions_by_category, get_metrics_by_category, and get_property_schema.

GA4 Credentialing & Property Access

Access GA4 data via service account credentials and GA4_PROPERTY_ID environment variable for secure property access.

200+ GA4 Dimensions & Metrics Catalog

Access to a broad catalog of GA4 dimensions and metrics organized by category (Time, Geography, Technology, etc.).

Flexible Deployment & Configuration

Install via pip or GitHub download with MCP JSON configuration and environment variables for credentials and property ID.

Audience

Data ScientistsQuery GA4 data and perform multi-dimensional analysis for LLM-powered insights.
ML EngineersIntegrate GA4 analytics into MCP-based workflows for natural language querying.
Marketing AnalystsExplore website traffic and user behavior using natural language queries via MCP clients.

Tags

Google Analytics 4GA4MCP ServerNatural Language QueryData DiscoveryAnalytics APIClaudeCursorE-commerceWeb Analytics