Ga4 MCP Server

Google Analytics 4 MCP: reports, realtime data, custom dimensions, data streams.

Local serverstdio

What is the Ga4 MCP Server?

Google Analytics 4 MCP: reports, realtime data, custom dimensions, data streams.

What the server does

  • 9 tools covering reporting, realtime data, custom dimensions/metrics, data streams, and feedback
  • Two configuration modes: single-property (env vars) and multi-client (config.json)
  • Supports both service account and OAuth credentials
  • Relative date support (today, yesterday, 7daysAgo, 30daysAgo, 90daysAgo)
  • Built on official Google SDKs with resilience patterns

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
ga4_get_client_contextReturns the active GA4 property ID and client name
ga4_run_reportRun a standard GA4 report with dimensions, metrics, date range, and filters
ga4_realtime_reportQuery realtime data (last 30 minutes)
ga4_list_custom_dimensionsList all custom dimensions for the property
ga4_create_custom_dimensionCreate a new custom dimension
ga4_list_custom_metricsList all custom metrics for the property
ga4_list_data_streamsList web/app data streams and their measurement IDs
ga4_send_feedbackSubmit feedback on a query result
ga4_suggest_improvementSuggest a new query pattern or improvement

How to install the Ga4 MCP Server

claude mcp add ga4 --env GA4_PROPERTY_ID=your-value --env GOOGLE_APPLICATION_CREDENTIALS=your-value --env GA4_CLIENT_ID=your-value --env GA4_CLIENT_SECRET=your-value --env GA4_REFRESH_TOKEN=your-value --env REFRESH_TOKEN=your-value -- npx -y mcp-ga4

Configuration

VariableDescriptionRequired
GA4_PROPERTY_IDConfiguration value read at startup.Optional
GOOGLE_APPLICATION_CREDENTIALSConfiguration value read at startup.Optional
GA4_CLIENT_IDConfiguration value read at startup.Optional
GA4_CLIENT_SECRETCredential the server authenticates with.Yes
GA4_REFRESH_TOKENCredential the server authenticates with.Yes
REFRESH_TOKENCredential the server authenticates with.Yes

Example prompts to try

  • “Use Ga4 to ga4 get client context.”
  • “Use Ga4 to ga4 run report.”
  • “Use Ga4 to ga4 realtime report.”

Frequently asked questions

Google Analytics 4 MCP: reports, realtime data, custom dimensions, data streams. Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.