mharnett avatar

Ga4

mharnett/mcp-ga4

Connects Claude to Google Analytics 4 properties through both the Data API and Admin API. You get nine tools covering standard reports, realtime queries, custom dimension and metric management, and data stream inspection. Supports both single property mode via environment variables and multi-client mode with automatic property switching based on working directory. Built on the official Google Analytics SDKs with retry logic and circuit breakers. Handles relative dates like "7daysAgo" and "30daysAgo" out of the box. Works with service accounts or OAuth credentials. Reach for this when you need to pull GA4 data, debug tracking setups, or manage custom dimensions without leaving your Claude workflow.

tools
9
auth
Required
transport
STDIO
env vars
2
last updated
Apr 8, 2026

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.

Sponsors

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
Monitoring & Observability, Data & Analytics
Package
mcp-ga4
Transport
STDIO
Auth
Required
Registry
MCP registry, active

More from mharnett

Related Monitoring & Observability MCP servers

View all
1mikerawsonnz avatarTraced Llm Proxymikerawsonnz/gosce-agentsProxy Gemini (Vertex AI) completions wrapped in OpenTelemetry trace spans; returns the answer plus t0stars
2nvasilevv avatarPensiata - Bulgarian Pension Fund Analyticsnvasilevv/pensiata-mcpBulgarian pension fund analytics — NAV data, metrics, rankings, and benchmarks.0stars
3kayembahamid avatarCybersim Prokayembahamid/cybersim-proCybersecurity training, simulation, and incident response MCP server0stars
4lanternrow avatarFacebook Pages Mcplanternrow/facebook-pages-mcpFacebook Pages organic analytics, post management, and insights via Meta Graph API v25.0.0stars
5nicofains1 avatarAgentWatchnicofains1/agentwatchMulti-agent observability: cascade failure detection, heartbeats, and forensic replay0stars
6posthog avatarPostHog MCP Serverposthog/posthogOfficial PostHog MCP Server for product analytics, feature flags, experiments, and more.35Kstars