MCP Google Analytics logo

MCP Google Analytics

Read GA4 reports, audit properties, send events, and verify activity through 26 MCP tools.

Install MCP Google Analytics

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "mcp-google-analytics": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-google-analytics"
      ],
      "env": {
        "GA_SERVICE_ACCOUNT_JSON": "YOUR_VALUE_HERE",
        "GA_PROPERTY_ID": "YOUR_VALUE_HERE",
        "GA_MEASUREMENT_ID": "YOUR_VALUE_HERE",
        "GA_API_SECRET": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Automated check passed— started and listed 26 tools correctly (Today).

Overview

The mcp-google-analytics MCP server connects AI agents to Google Analytics 4 through the Google Analytics Data API and Measurement Protocol v2. It provides tools for reports, realtime data, funnels, property audits, account discovery, and server-side event delivery. Read access uses a service account and property ID, while event sending additionally requires a Measurement ID and API secret. Reach for it when an agent needs both GA4 analysis and event collection, including workflows spanning multiple properties.

Use cases

  • Run GA4 reports by dimension and metric
  • Audit custom dimensions, metrics, and key events
  • Compare multiple accessible GA4 properties
  • Send and validate server-side ecommerce events
  • Verify events in realtime reports

Key features

  • GA4 Data API reporting
  • Measurement Protocol event sending
  • Funnel, pivot, batch, and realtime reports
  • Property and account discovery
  • Configuration and compatibility audits
  • Multi-property read access

Tools26

What MCP Google Analytics lets your agent do. Expand a tool for its parameters.

Verified live~6.3k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

9/9 checks healthy over the last 45d

What it can do

From the 26 tools this server returned when we ran it; 26 declare their own safety hints.

Handles credentials · 6Makes network requests · 26Read-only tools · 26
Network at startup3 connections
Files written at startupNone
Install scriptsprepare
npm provenanceNot published
Package age338 days
Maintainers1

Observed 2026-10-28 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 23h ago via OSV.dev · mcp-google-analytics (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars2Stargazers on the source repository.
npm downloads6.9kPackage downloads in the last 30 days.
Last commit2mo agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed26Callable tools this server registers over MCP.

How MCP Google Analytics works

What mcp-google-analytics does

The mcp-google-analytics MCP server gives an AI agent access to Google Analytics 4 data and selected administration details. Its read operations use the Google Analytics Data API, while event submission uses Measurement Protocol v2. This supports workflows that combine analysis, configuration checks, event delivery, and verification.

The server includes 26 tools covering custom reports, realtime reports, funnels, pivot reports, account and property discovery, data streams, metadata, custom dimensions, custom metrics, key events, linked Google Ads accounts, and compatibility checks. It can also send custom events, page or screen views, and purchases, or validate an event without recording it.

How it works

The server runs as an npm package through npx or as a globally installed command. An MCP-compatible client starts the process and supplies credentials through environment variables. Read tools query the configured GA4 property, and each read tool defaults to 10 results to limit response size. Callers can increase the limit value and narrow reports with specific dimensions, metrics, and date ranges.

A read tool can receive a propertyId argument to override the default property. This makes it possible to query several properties that the service account can access without changing the client configuration. IDs may be provided as numbers or in the properties/123456789 form. Event submission remains associated with the configured Measurement ID and API secret for its data stream.

Setup and configuration

Install with npm install -g mcp-google-analytics, or run it without a global install using npx mcp-google-analytics. Configure GA_SERVICE_ACCOUNT_JSON with either a path to a downloaded service-account key or the JSON content itself. Set GA_PROPERTY_ID to the numeric GA4 property ID for the default read target.

Before querying data, enable the Google Analytics Data API in Google Cloud and grant the service account Viewer access to the GA4 property. For the mcp-google-analytics MCP server to send events, also set GA_MEASUREMENT_ID to the relevant web or app data-stream Measurement ID and GA_API_SECRET to a Measurement Protocol API secret.

Claude Desktop and Cursor configurations use the MCP command and args fields with npx -y mcp-google-analytics. Restart the client after changing its configuration. Agencies can omit the default property ID when using per-request propertyId values, provided the service account has access to the target properties.

Tools and capabilities

Read-oriented tools include:

  • ga_run_report for configurable dimensions and metrics
  • ga_run_realtime_report for the previous 30 minutes
  • ga_run_funnel_report and ga_run_pivot_report for specialized analyses
  • ga_batch_run_reports for multiple reports in one request
  • ga_get_metadata for available dimensions and metrics
  • Account, property, data-stream, custom-dimension, custom-metric, key-event, and Google Ads link discovery
  • ga_check_compatibility for validating dimension and metric combinations

Event tools include ga_send_event, ga_validate_event, ga_send_pageview, and ga_send_purchase. The validation tool checks an event through the debug endpoint without recording it. Realtime reporting can then help verify recorded events.

Limitations and notes

The service account must have access to every property it queries. Sending events is optional and depends on both Measurement Protocol credentials; it is tied to one configured data stream rather than the per-property read override. Metadata and pivot responses can be large, so they should be used selectively. Reports may also consume substantial context if broad date ranges, many dimensions, or high result limits are requested. The mcp-google-analytics MCP server is distributed under the MIT license.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about MCP Google Analytics

mcp-google-analytics is an MCP server that connects AI agents to Google Analytics 4 through the Google Analytics Data API and Measurement Protocol v2. Its main tools run reports, inspect funnels and property configuration, send events, validate events, and check realtime data.

Install it globally with `npm install -g mcp-google-analytics` or run it with `npx mcp-google-analytics`. Configure the MCP client to start the package, then provide the service-account JSON and GA4 property ID as environment variables.

Set `GA_SERVICE_ACCOUNT_JSON` and `GA_PROPERTY_ID`. Enable the Google Analytics Data API, download a service-account key, and grant that account Viewer access to the GA4 property. The property ID is the numeric value in GA4 Property Settings.

Set `GA_MEASUREMENT_ID` and `GA_API_SECRET` in addition to the read configuration. Use `ga_send_event`, `ga_send_pageview`, or `ga_send_purchase`; use `ga_validate_event` to test an event through the debug endpoint without recording it.

Yes, mcp-google-analytics works with Cursor through its MCP settings file. Add an entry that runs `npx -y mcp-google-analytics` and supplies the required environment variables, then restart Cursor after saving the configuration.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMCP Google Analytics AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/mcp-google-analytics?style=directory)](https://allmcps.com/mcp/mcp-google-analytics)
HTML Embed
<a href="https://allmcps.com/mcp/mcp-google-analytics"><img src="https://allmcps.com/api/badge/mcp-google-analytics?style=directory" alt="MCP Google Analytics on AllMCPs" /></a>