
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.
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 paramsTool 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.
propertystringrequestsarrayGOOGLE_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 paramsTool 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.
compatibilityFilterstringCOMPATIBILITY_UNSPECIFIED · COMPATIBLE · INCOMPATIBLEdimensionFilterobjectdimensionsarraymetricFilterobjectmetricsarraypropertystringGOOGLE_ANALYTICS_CREATE_AUDIENCE_EXPORTTool to create an audience export. Use after configuring the audience and dimensions to produce a long-running Operation.3 paramsTool to create an audience export. Use after configuring the audience and dimensions to produce a long-running Operation.
audiencestringdimensionsarrayparentstringGOOGLE_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 paramsTool to create an audience list. Use when you need to define and asynchronously populate a new AudienceList resource under a GA4 property.
audiencestringdimensionsarrayparentstringwebhookNotificationobjectGOOGLE_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 paramsTool 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.
expandedDataSetobjectparentstringGOOGLE_ANALYTICS_CREATE_ROLLUP_PROPERTYTool to create a GA4 Roll-up Property and optionally initial source links.4 paramsTool to create a GA4 Roll-up Property and optionally initial source links.
accountstringdisplayNamestringsourcePropertiesarraytimeZonestringGOOGLE_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 paramsTool 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).
namestringGOOGLE_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 paramsTool to get configuration metadata for an Audience Export. Use after creating an Audience Export to retrieve its status and details.
namestringGOOGLE_ANALYTICS_GET_AUDIENCE_LISTTool to get configuration metadata about a specific audience list. Use after confirming the audience list resource name.1 paramsTool to get configuration metadata about a specific audience list. Use after confirming the audience list resource name.
namestringGOOGLE_ANALYTICS_GET_KEY_EVENTTool to retrieve a Key Event. Use after confirming the key event resource name.1 paramsTool to retrieve a Key Event. Use after confirming the key event resource name.
namestringGOOGLE_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 paramsTool to get metadata for dimensions, metrics, and comparisons for a GA4 property. Use when you need to discover available fields before building a report.
namestringGOOGLE_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 paramsTool 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.
propertystringGOOGLE_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 paramsTool to list all Accounts accessible by the caller. Use when you need to enumerate all Google Analytics accounts your credentials can access.
pageSizeintegerpageTokenstringshowDeletedbooleanGOOGLE_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 paramsTool to list all audience exports for a GA4 property. Use when you need to fetch its export history after initiating exports.
pageSizeintegerpageTokenstringparentstringGOOGLE_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 paramsTool 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.
pageSizeintegerpageTokenstringparentstringGOOGLE_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 paramsTool to list all audiences on a property. Use when you need to fetch all audiences for a GA4 property after confirming its existence.
pageSizeintegerpageTokenstringparentstringGOOGLE_ANALYTICS_LIST_KEY_EVENTSTool to list Key Events. Use when you need to retrieve all key event definitions for a given property.3 paramsTool to list Key Events. Use when you need to retrieve all key event definitions for a given property.
pageSizeintegerpageTokenstringparentstringGOOGLE_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 paramsTool to list GA4 properties under a specific account. Use after obtaining an account ID; supports pagination and including soft-deleted properties.
accountstringpageSizeintegerpageTokenstringshowDeletedbooleanGOOGLE_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 paramsTool to list all Reporting Data Annotations on a property. Use when you need to retrieve or inspect annotations for a GA4 property.
filterstringpageSizeintegerpageTokenstringparentstringGOOGLE_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 paramsTool to list roll-up GA4 properties accessible to the caller. Use when you need to identify roll-up properties across all accessible accounts.
pageSizeintegerGOOGLE_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 paramsTool to list all SearchAds360Links on a property. Use when you need to fetch all Search Ads 360 links for a given property after authenticating.
pageSizeintegerpageTokenstringparentstringGOOGLE_ANALYTICS_QUERY_AUDIENCE_EXPORTTool to query a completed audience export. Use when you need to fetch user rows with pagination.3 paramsTool to query a completed audience export. Use when you need to fetch user rows with pagination.
limitintegernamestringoffsetintegerGOOGLE_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 paramsTool to query an audience list. Use when you need to retrieve user rows from a GA4 audience list with pagination.
limitintegernamestringoffsetintegerGOOGLE_ANALYTICS_RUN_FUNNEL_REPORTTool to run a GA4 funnel report. Use when you need a customized funnel analysis report for a given property.10 paramsTool to run a GA4 funnel report. Use when you need a customized funnel analysis report for a given property.
dateRangesarraydimensionFilterobjectfunnelobjectfunnelBreakdownobjectfunnelNextActionobjectfunnelVisualizationTypestringSTANDARD_FUNNEL · TRENDED_FUNNELlimitintegerpropertystringreturnPropertyQuotabooleansegmentsarrayGOOGLE_ANALYTICS_RUN_REPORTTool to run a customized GA4 data report. Use when you need event data after specifying dimensions, metrics, and date ranges.15 paramsTool to run a customized GA4 data report. Use when you need event data after specifying dimensions, metrics, and date ranges.
cohortSpecobjectcomparisonsarraycurrencyCodestringdateRangesarraydimensionFilterobjectdimensionsarraykeepEmptyRowsbooleanlimitintegermetricAggregationsarraymetricFilterobjectmetricsarrayoffsetintegerorderBysarraypropertystringreturnPropertyQuotabooleanModel Context Protocol (MCP) server for Google Analytics 4: real-time query exploration, schema discovery, metric aggregation, and audience insights for AI agents.
🌐 Live Documentation & Web Portal: https://ga4.builditwithai.xyz
# 1-Line Universal Installer (Auto-configures Claude Desktop, Cursor, Claude Code, Antigravity, VS Code, Zed, Windsurf)
curl -fsSL "https://ga4.builditwithai.xyz/install" | bash
# Or run directly via your preferred runtime:
uvx google-analytics-mcp
uvx --from google-analytics-mcp ga4-mcp-server
python -m ga4_mcp
npx -y @surendranb/google-analytics-mcp
claude mcp add google-analytics -- uvx google-analytics-mcp
mcp.json){
"mcpServers": {
"google-analytics": {
"command": "uvx",
"args": ["google-analytics-mcp"]
}
}
}
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"
}
}
}
}
{
"mcpServers": {
"google-analytics": {
"command": "npx",
"args": ["-y", "@surendranb/google-analytics-mcp"]
}
}
}
| Tool Name | Parameters | Description | Return Type |
|---|---|---|---|
get_ga4_data | dimensions (list), metrics (list), date_ranges (list), limit (int) | Runs multi-dimensional GA4 reports with automated metric totals and server-side aggregation. | JSON / Markdown |
list_accounts | (none) | Lists all accessible Google Analytics accounts and permission levels. | JSON |
list_properties | account_id (optional) | Lists all GA4 properties associated with an account. | JSON |
get_property_metadata | property_id (optional) | Fetches complete dimension and metric schemas, custom definitions, and compatibility rules. | JSON |
run_realtime_report | metrics (list), dimensions (list) | Queries real-time active users and event counts from the last 30 minutes. | JSON |
search_skills | query (string) | Searches built-in GA4 analytical playbooks (e-commerce, channel attribution, bot filtering). | Markdown |
skill_read | skill_name (string) | Dynamically loads procedural skills and analytical guides from GitHub. | Markdown |
skills_list | (none) | Lists all available live GA4 analytical skills. | JSON |
This server ships with built-in analytical recipes that load dynamically from GitHub:
traffic-diagnosis: Step-by-step root cause analysis for sudden traffic drops.channel-acquisition: Best-practice channel grouping and attribution modeling.ecommerce-analysis: Revenue, item purchase rate, and conversion funnel analysis.ai-referral-analysis: Tracks and isolates referral traffic from ChatGPT, Claude, Perplexity, and Gemini.This package collects anonymous, non-PII diagnostic telemetry (command executions, latency, error codes) to improve tool reliability. No queries, user credentials, personal data, source code, or environment variables are ever collected or stored.
You can opt out anytime by setting either of the following environment variables:
export DO_NOT_TRACK=1
# or
export MCP_TELEMETRY_OPT_OUT=1
MIT License. See LICENSE for details.
YOUR_API_KEY*secretYour API key for the service