surendranb avatar

Google Analytics Mcp

surendranb/google-analytics-mcp

The Google Analytics MCP server connects Google Analytics 4 data to AI agents and workflows, providing analysis-ready access to website traffic, user behavior, and performance metrics through tools like live schema discovery, server-side aggregation, and safe defaults that minimize data processing overhead. It enables agents to query GA4 properties directly via the Google Analytics Data API using a service account, reducing the need for manual data wrangling and making analytics insights accessible across Claude, ChatGPT, Cursor, and other MCP-compatible platforms. The server solves the problem of agents spending excessive time preparing raw analytics data for analysis by pre-aggregating results server-side and estimating large datasets to prevent workflow disruptions.

GitHub stars
244
tools
25
auth
Secret needed
transport
STDIO
env vars
2
last updated
Oct 28, 2026

Tools

25 tools

Public tool metadata for what this MCP can expose to an agent.

GOOGLE_ANALYTICS_BATCH_RUN_REPORTSTool to return multiple analytics data reports in a batch. Use when you need to fetch multiple reports for one GA4 property in a single request.2 params

Tool to return multiple analytics data reports in a batch. Use when you need to fetch multiple reports for one GA4 property in a single request.

Parameters* required
propertystring
Required. The property resource name. Format: properties/{property_id}
requestsarray
Required. Up to 5 individual RunReportRequest objects.
GOOGLE_ANALYTICS_CHECK_COMPATIBILITYTool to list dimensions and metrics compatible with a GA4 report request. Use when you need to validate compatibility of chosen dimensions or metrics before running a report.6 params

Tool to list dimensions and metrics compatible with a GA4 report request. Use when you need to validate compatibility of chosen dimensions or metrics before running a report.

Parameters* required
compatibilityFilterstring
Compatibility status for dimensions or metrics.one of COMPATIBILITY_UNSPECIFIED · COMPATIBLE · INCOMPATIBLE
dimensionFilterobject
Optional. A FilterExpression for dimensions; must follow GA4 FilterExpression JSON schema.
dimensionsarray
Optional. List of dimensions to check compatibility for.
metricFilterobject
Optional. A FilterExpression for metrics; must follow GA4 FilterExpression JSON schema.
metricsarray
Optional. List of metrics to check compatibility for.
propertystring
Required. GA4 property resource name. Format: properties/{property_id}.
GOOGLE_ANALYTICS_CREATE_AUDIENCE_EXPORTTool to create an audience export. Use after configuring the audience and dimensions to produce a long-running Operation.3 params

Tool to create an audience export. Use after configuring the audience and dimensions to produce a long-running Operation.

Parameters* required
audiencestring
Audience resource name to export. Format: properties/{property_id}/audiences/{audience_id}.
dimensionsarray
List of dimensions to include in the export.
parentstring
Parent resource name. Format: properties/{property_id}.
GOOGLE_ANALYTICS_CREATE_AUDIENCE_LISTTool to create an audience list. Use when you need to define and asynchronously populate a new AudienceList resource under a GA4 property.4 params

Tool to create an audience list. Use when you need to define and asynchronously populate a new AudienceList resource under a GA4 property.

Parameters* required
audiencestring
Audience resource name. Format: properties/{property_id}/audiences/{audience_id}.
dimensionsarray
List of dimensions to include in the audience list output.
parentstring
Parent property resource name. Format: properties/{property_id}.
webhookNotificationobject
Configuration for receiving webhook notifications about operation status.
GOOGLE_ANALYTICS_CREATE_EXPANDED_DATA_SETTool to create an expanded data set for a property. Use when you need to combine specific dimensions and metrics into a custom dataset after property creation.2 params

Tool to create an expanded data set for a property. Use when you need to combine specific dimensions and metrics into a custom dataset after property creation.

Parameters* required
expandedDataSetobject
Definition of the ExpandedDataSet to create.
parentstring
Parent property resource name. Format: properties/{propertyId}
GOOGLE_ANALYTICS_CREATE_ROLLUP_PROPERTYTool to create a GA4 Roll-up Property and optionally initial source links.4 params

Tool to create a GA4 Roll-up Property and optionally initial source links.

Parameters* required
accountstring
Required. Parent account resource. Format: accounts/{account_id}
displayNamestring
Required. Display name for the roll-up property.
sourcePropertiesarray
Optional. List of source property resource names to link. Format: properties/{property_id}.
timeZonestring
Required. IANA time zone for the roll-up property.
GOOGLE_ANALYTICS_GET_ACCOUNTTool to retrieve a single Account by its resource name. Use when you need detailed account info after confirming the account resource name (e.g., accounts/100).1 params

Tool to retrieve a single Account by its resource name. Use when you need detailed account info after confirming the account resource name (e.g., accounts/100).

Parameters* required
namestring
Required. The resource name of the Account to retrieve. Format: accounts/{account_id}, e.g., 'accounts/100'.
GOOGLE_ANALYTICS_GET_AUDIENCE_EXPORTTool to get configuration metadata for an Audience Export. Use after creating an Audience Export to retrieve its status and details.1 params

Tool to get configuration metadata for an Audience Export. Use after creating an Audience Export to retrieve its status and details.

Parameters* required
namestring
Required. The resource name of the Audience Export to retrieve. Format: properties/{property}/audienceExports/{audienceExport}.
GOOGLE_ANALYTICS_GET_AUDIENCE_LISTTool to get configuration metadata about a specific audience list. Use after confirming the audience list resource name.1 params

Tool to get configuration metadata about a specific audience list. Use after confirming the audience list resource name.

Parameters* required
namestring
Required. The resource name of the Audience List to retrieve. Format: properties/{property}/audienceLists/{audienceList}.
GOOGLE_ANALYTICS_GET_KEY_EVENTTool to retrieve a Key Event. Use after confirming the key event resource name.1 params

Tool to retrieve a Key Event. Use after confirming the key event resource name.

Parameters* required
namestring
Required. Resource name of the Key Event to retrieve. Format: properties/{property}/keyEvents/{keyEvent}.
GOOGLE_ANALYTICS_GET_METADATATool to get metadata for dimensions, metrics, and comparisons for a GA4 property. Use when you need to discover available fields before building a report.1 params

Tool to get metadata for dimensions, metrics, and comparisons for a GA4 property. Use when you need to discover available fields before building a report.

Parameters* required
namestring
Resource name of the metadata to retrieve. Format: properties/{property_id}/metadata. Use property_id=0 to return only universal (non-custom) metadata.
GOOGLE_ANALYTICS_GET_PROPERTY_QUOTAS_SNAPSHOTTool to retrieve all property quotas organized by category for a given property. Use when you need to check current quota usage for a GA4 property.1 params

Tool to retrieve all property quotas organized by category for a given property. Use when you need to check current quota usage for a GA4 property.

Parameters* required
propertystring
Required. The property resource. Format: properties/{property_id}.
GOOGLE_ANALYTICS_LIST_ACCOUNTSTool to list all Accounts accessible by the caller. Use when you need to enumerate all Google Analytics accounts your credentials can access.3 params

Tool to list all Accounts accessible by the caller. Use when you need to enumerate all Google Analytics accounts your credentials can access.

Parameters* required
pageSizeinteger
Optional. Maximum number of accounts to return. Must be ≥1.
pageTokenstring
Optional. Token for retrieving the next page of results.
showDeletedboolean
Optional. Whether to include soft-deleted (trashed) Accounts.
GOOGLE_ANALYTICS_LIST_AUDIENCE_EXPORTSTool to list all audience exports for a GA4 property. Use when you need to fetch its export history after initiating exports.3 params

Tool to list all audience exports for a GA4 property. Use when you need to fetch its export history after initiating exports.

Parameters* required
pageSizeinteger
Optional. Maximum number of results to return. Defaults to 200; larger values are coerced to 1000.
pageTokenstring
Optional. Token for retrieving the next page of results; other parameters must match original call when paginating.
parentstring
Required. Resource name of the parent property. Format: properties/{property_id}
GOOGLE_ANALYTICS_LIST_AUDIENCE_LISTSTool to list all audience lists for a GA4 property. Use when you need to retrieve a property's configured audience lists after confirming the property ID.3 params

Tool to list all audience lists for a GA4 property. Use when you need to retrieve a property's configured audience lists after confirming the property ID.

Parameters* required
pageSizeinteger
Optional. Maximum number of audience lists to return. Defaults to 200; maximum is 1000.
pageTokenstring
Optional. Token for retrieving the next page of results.
parentstring
Required. Resource name of the parent property. Format: properties/{property_id}
GOOGLE_ANALYTICS_LIST_AUDIENCESTool to list all audiences on a property. Use when you need to fetch all audiences for a GA4 property after confirming its existence.3 params

Tool to list all audiences on a property. Use when you need to fetch all audiences for a GA4 property after confirming its existence.

Parameters* required
pageSizeinteger
Optional. Maximum number of Audiences to return.
pageTokenstring
Optional. Token for retrieving the next page of results.
parentstring
Required. Property ID or full resource name. Accepts: '123456789' or 'properties/123456789'
GOOGLE_ANALYTICS_LIST_KEY_EVENTSTool to list Key Events. Use when you need to retrieve all key event definitions for a given property.3 params

Tool to list Key Events. Use when you need to retrieve all key event definitions for a given property.

Parameters* required
pageSizeinteger
Optional. Maximum number of results to return. Must be between 1 and 200.
pageTokenstring
Optional. Token for retrieving the next page of results.
parentstring
Required. Resource name of the parent property. Format: properties/{property_id}.
GOOGLE_ANALYTICS_LIST_PROPERTIESTool to list GA4 properties under a specific account. Use after obtaining an account ID; supports pagination and including soft-deleted properties.4 params

Tool to list GA4 properties under a specific account. Use after obtaining an account ID; supports pagination and including soft-deleted properties.

Parameters* required
accountstring
Required. The account resource name. Format: accounts/{account_id}
pageSizeinteger
Optional. Maximum number of properties to return; must be between 1 and 200.
pageTokenstring
Optional. Token returned from a previous call to retrieve the next page of results.
showDeletedboolean
Optional. Whether to include soft-deleted (trashed) properties.
GOOGLE_ANALYTICS_LIST_REPORTING_DATA_ANNOTATIONSTool to list all Reporting Data Annotations on a property. Use when you need to retrieve or inspect annotations for a GA4 property.4 params

Tool to list all Reporting Data Annotations on a property. Use when you need to retrieve or inspect annotations for a GA4 property.

Parameters* required
filterstring
Restricts which annotations are listed. Supported fields: name, title, description, annotationDate, annotationDateRange, color; operations: =, !=, <, >, <=, >=, :, =~, !~, NOT, AND, OR; helper func...
pageSizeinteger
Optional. Maximum number of annotations to return. Defaults to 50, max 200.
pageTokenstring
Optional. Token for retrieving the next page of results.
parentstring
Resource name of the property. Format: properties/{property_id}.
GOOGLE_ANALYTICS_LIST_ROLLUP_PROPERTIESTool to list roll-up GA4 properties accessible to the caller. Use when you need to identify roll-up properties across all accessible accounts.1 params

Tool to list roll-up GA4 properties accessible to the caller. Use when you need to identify roll-up properties across all accessible accounts.

Parameters* required
pageSizeinteger
Optional. Maximum number of account summaries to return; must be between 1 and 200.
GOOGLE_ANALYTICS_LIST_SEARCH_ADS360_LINKSTool to list all SearchAds360Links on a property. Use when you need to fetch all Search Ads 360 links for a given property after authenticating.3 params

Tool to list all SearchAds360Links on a property. Use when you need to fetch all Search Ads 360 links for a given property after authenticating.

Parameters* required
pageSizeinteger
Optional. Maximum number of results to return. Must be between 1 and 200. Defaults to 50.
pageTokenstring
Optional. Token for retrieving the next page of results.
parentstring
Required. Resource name of the property. Format: properties/{propertyId} (e.g., properties/1234).
GOOGLE_ANALYTICS_QUERY_AUDIENCE_EXPORTTool to query a completed audience export. Use when you need to fetch user rows with pagination.3 params

Tool to query a completed audience export. Use when you need to fetch user rows with pagination.

Parameters* required
limitinteger
Optional. Number of rows to return. Must be between 1 and 250000. Defaults to 10000.
namestring
Required. Resource name of the audience export. Format: properties/{property}/audienceExports/{audienceExport}.
offsetinteger
Optional. Zero-based start row index for pagination. Defaults to 0.
GOOGLE_ANALYTICS_QUERY_AUDIENCE_LISTTool to query an audience list. Use when you need to retrieve user rows from a GA4 audience list with pagination.3 params

Tool to query an audience list. Use when you need to retrieve user rows from a GA4 audience list with pagination.

Parameters* required
limitinteger
Optional. Number of rows to return; default 10,000; maximum 250,000.
namestring
Required. Audience list resource to query. Format: properties/{property}/audienceLists/{audienceList}.
offsetinteger
Optional. Zero-based row offset for pagination.
GOOGLE_ANALYTICS_RUN_FUNNEL_REPORTTool to run a GA4 funnel report. Use when you need a customized funnel analysis report for a given property.10 params

Tool to run a GA4 funnel report. Use when you need a customized funnel analysis report for a given property.

Parameters* required
dateRangesarray
List of date ranges to read; overlapping ranges duplicate days across ranges.
dimensionFilterobject
Dimension-only filter expression.
funnelobject
Funnel configuration object following the API schema (must include 'steps').
funnelBreakdownobject
Breakdown dimension configuration for the funnel table sub-report.
funnelNextActionobject
Next-action dimension configuration for the funnel visualization sub-report.
funnelVisualizationTypestring
Visualization type: STANDARD_FUNNEL (default) or TRENDED_FUNNEL.one of STANDARD_FUNNEL · TRENDED_FUNNEL
limitinteger
Number of rows to return. Default 10000; max 250000.
propertystring
GA4 property resource name, format: properties/{property_id}.
returnPropertyQuotaboolean
If true, includes the property's current quota state.
segmentsarray
Up to 4 segments; each yields its own row in the report.
GOOGLE_ANALYTICS_RUN_REPORTTool to run a customized GA4 data report. Use when you need event data after specifying dimensions, metrics, and date ranges.15 params

Tool to run a customized GA4 data report. Use when you need event data after specifying dimensions, metrics, and date ranges.

Parameters* required
cohortSpecobject
Optional. Cohort specification. Requires requesting the cohort dimension.
comparisonsarray
Optional. The comparison configuration. Adds a comparison column to the response.
currencyCodestring
Optional. The currency code to apply, in ISO 4217 format. Defaults to property currency.
dateRangesarray
Optional. The date ranges to read. Each range requires 'startDate' and 'endDate'.
dimensionFilterobject
Optional. The filter expression to restrict dimension values. Only dimensions are allowed.
dimensionsarray
Optional. The dimensions to request and display. Each dimension is an object with a 'name' field.
keepEmptyRowsboolean
Optional. If true, rows with all zero metrics will be returned; otherwise omitted.
limitinteger
Optional. Number of rows to return. Must be between 1 and 250000.
metricAggregationsarray
Optional. Aggregation types to include over metrics, e.g., 'TOTAL', 'MINIMUM', 'MAXIMUM'.
metricFilterobject
Optional. The filter expression to restrict metric values. Applied after aggregation.
metricsarray
Optional. The metrics to request and display. Each metric is an object with a 'name' field.
offsetinteger
Optional. 0-based start row for pagination. Must be >= 0.
orderBysarray
Optional. Specify how rows are ordered. Each object defines dimension or metric ordering.
propertystring
Required. The property resource on which to run the report. Format: properties/{property_id}.
returnPropertyQuotaboolean
Optional. If true, include the property's current quota state in the response.

Sponsors

Configuration

GOOGLE_APPLICATION_CREDENTIALS*secret

Absolute path to your Google Cloud service account JSON key with GA4 property access.

GA4_PROPERTY_ID*

Numeric GA4 Property ID to query, for example 123456789.

Readme

Google Analytics MCP Logo

Google Analytics 4 (GA4) MCP Server 📊

Model Context Protocol (MCP) server for Google Analytics 4: real-time query exploration, schema discovery, metric aggregation, and audience insights for AI agents.

CI PyPI version npm version OpenSSF Scorecard License: MIT


View the full README on GitHub

Details

Repository
github.com/surendranb/google-analytics-mcp
Categories
Monitoring & Observability, Data & Analytics
Package
google-analytics-mcp
Transport
STDIO
Auth
Required
Registry
MCP registry, active

Related Monitoring & Observability MCP servers

View all
1nikolai-vysotskyi avatarTrace Mcpnikolai-vysotskyi/trace-mcpCode graph MCP: 81 languages, 91 frameworks, 72.7% fewer PR-review tokens, comprehension at parity203stars
2siddhant-k-code avataragent-stracesiddhant-k-code/agent-traceQuery recorded AI agent sessions: events, summaries, diffs, health, skills, PR reviewability.104stars
3tocharianou avatarKibanatocharianou/mcp-server-kibanaKibana MCP Server with dynamic API discovery and comprehensive Elastic Stack integration86stars
4ralfbecher avatarOrionbelt Analyticsralfbecher/orionbelt-analyticsOntology-based MCP server for database schema analysis and RDF/OWL ontology generation32stars
5zw008 avatarVMware Monitorzw008/vmware-monitorRead-only VMware vCenter/ESXi monitoring with 27 MCP tools. Code-level safety.18stars
6mindstone avatarGoogle Analytics 4mindstone/mcp-serversGoogle Analytics 4 MCP server with reporting, schema discovery, and admin visibility tools0stars