Skip to content
mharnett avatar

Ga4

mharnett/mcp-ga4

Read and report access to Google Analytics 4 properties: standard reports, realtime data, and custom dimensions.

CCM score
74 of 100
GitHub stars
1
tools
9
auth
Required
transport
STDIO
env vars
2
last updated
Nov 25, 2026
View on GitHub

Own this MCP server? Claim it

What it does

  • Reads data with ga4_run_report and ga4_realtime_report, covering dimensions, metrics, date ranges, filters, and the last 30 minutes of activity
  • Lists configuration with ga4_list_custom_dimensions, ga4_list_custom_metrics, and ga4_list_data_streams; creates dimensions with ga4_create_custom_dimension only when GA4_MCP_WRITE=true
  • Requires a Google service-account keyfile or user OAuth credentials with access to the GA4 property, plus a property ID
  • Designed for analysts and developers who want to query GA4 reports from Claude without leaving the chat

Tools

9 tools

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

ga4_get_client_contextReturns the active GA4 property ID and client name

Returns the active GA4 property ID and client name

No parameter schema in public metadata yet.

ga4_run_reportRun a standard GA4 report with dimensions, metrics, date range, and filters

Run a standard GA4 report with dimensions, metrics, date range, and filters

No parameter schema in public metadata yet.

ga4_realtime_reportQuery realtime data (last 30 minutes)

Query realtime data (last 30 minutes)

No parameter schema in public metadata yet.

ga4_list_custom_dimensionsList all custom dimensions for the property

List all custom dimensions for the property

No parameter schema in public metadata yet.

ga4_create_custom_dimensionCreate a new custom dimension

Create a new custom dimension

No parameter schema in public metadata yet.

ga4_list_custom_metricsList all custom metrics for the property

List all custom metrics for the property

No parameter schema in public metadata yet.

ga4_list_data_streamsList web/app data streams and their measurement IDs

List web/app data streams and their measurement IDs

No parameter schema in public metadata yet.

ga4_send_feedbackSubmit feedback on a query result

Submit feedback on a query result

No parameter schema in public metadata yet.

ga4_suggest_improvementSuggest a new query pattern or improvement

Suggest a new query pattern or improvement

No parameter schema in public metadata yet.

Configuration

GA4_PROPERTY_ID*

GA4 property ID (numeric)

GOOGLE_APPLICATION_CREDENTIALS*

Path to service account JSON credentials file

Readme

mcp-ga4

MCP server for Google Analytics 4 -- run reports, realtime data, custom dimensions, and property management via Claude.

Quick install

Claude Code, one line (replace the placeholder values; see Authentication for a service account or user OAuth):

claude mcp add --env GA4_PROPERTY_ID=YOUR_PROPERTY_ID --env GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json --transport stdio ga4 -- npx -y mcp-ga4

For user OAuth instead of a service account, replace the credentials variable with GA4_CLIENT_ID, GA4_CLIENT_SECRET and GA4_REFRESH_TOKEN.

Claude Desktop

Add this to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS), then fully quit and restart Claude Desktop:

{
  "mcpServers": {
    "ga4": {
      "command": "npx",
      "args": ["-y", "mcp-ga4"],
      "env": {
        "GA4_PROPERTY_ID": "YOUR_PROPERTY_ID",
        "GOOGLE_APPLICATION_CREDENTIALS": "/path/to/service-account.json"
      }
    }
  }
}
Codex CLI

Add this to ~/.codex/config.toml:

[mcp_servers.ga4]
command = "npx"
args = ["-y", "mcp-ga4"]

View the full README on GitHub

Details

Repository
github.com/mharnett/mcp-ga4
Categories
Data & Analytics, Marketing, SEO & Ads
Package
mcp-ga4
Transport
STDIO
Auth
Required
Registry
MCP registry, active

Questions

What can an agent do with the ga4 MCP server?

The ga4 server lets an agent run Google Analytics 4 reports with dimensions, metrics, date ranges and filters, and query realtime data from the last 30 minutes. It also lists custom dimensions, custom metrics and web or app data streams with their measurement IDs.

Which tools does the ga4 MCP server provide?

It exposes 9 tools, including ga4_run_report, ga4_realtime_report, ga4_list_custom_dimensions and ga4_list_data_streams. Creating a custom dimension with ga4_create_custom_dimension changes GA4 and is only listed when GA4_MCP_WRITE=true is set.

What does the ga4 MCP server need to run?

It needs the environment variables GA4_PROPERTY_ID and GOOGLE_APPLICATION_CREDENTIALS, which points to a service account JSON file. Alternatively, user OAuth works with GA4_CLIENT_ID, GA4_CLIENT_SECRET and GA4_REFRESH_TOKEN. The service account must be granted access on the GA4 property.

Where does the ga4 MCP server rank in its category?

The ga4 server is in the Data & Analytics category on Claude Marketplaces and ranks in the top 50 there. It sits alongside servers such as Metabase, PostHog and Microsoft Fabric MCP Server in that category.

Similar to Ga4

More Data & Analytics