Skip to content
Google Analytics MCP Server

Google Analytics MCP Server

Released
v0.7.0
Apache-2.0

Summary

Google's own MCP server for GA4 — ask questions about traffic, conversions and funnels in plain language and get answers from the Analytics Data and Admin APIs.

Features

  • Published by the Google Analytics team
  • Reads the GA4 Data API: arbitrary dimension/metric reports over any date range
  • Real-time reports covering the last 30 minutes of activity
  • Funnel reports for multi-step conversion analysis
  • Discovers accounts, properties and custom dimensions/metrics so an agent can orient itself
  • Read-only by design — requires only the analytics.readonly OAuth scope

Installation

Set up this MCP server in your favorite AI agent — copy a ready-made configuration below.

Any MCP-compatible agent

Most agents (Claude, Cursor, Windsurf, VS Code, and more) read a standard mcpServers configuration.

  1. Open your agent's MCP configuration file.
  2. Merge the snippet below into it, filling in the environment variables with your own values.
  3. Restart the agent — the "Google Analytics MCP Server" tools will be available.
{
  "mcpServers": {
    "google-analytics-mcp": {
      "command": "pipx",
      "args": [
        "run",
        "analytics-mcp"
      ],
      "env": {
        "GOOGLE_APPLICATION_CREDENTIALS": "PATH_TO_CREDENTIALS_JSON",
        "GOOGLE_PROJECT_ID": "YOUR_PROJECT_ID"
      }
    }
  }
}

Description

Google Analytics 4 answers almost anything about a site, provided you can express the question as the right combination of dimensions, metrics, filters and date ranges. That combinatorial surface is exactly what a language model is good at assembling, which is the case for this server: it is published by the Google Analytics team and puts the GA4 Data and Admin APIs directly in front of an agent.

What it exposes
  • `get_account_summaries` — the accounts and properties the credential can see, which is how an agent finds the right property ID without being told one.
  • `get_property_details` — timezone, currency and configuration for a property, so reports come back interpreted correctly.
  • `get_custom_dimensions_and_metrics` — the property's custom definitions, which is what stops an agent from silently ignoring the events a team actually cares about.
  • `run_report` — the core Data API report: any dimension/metric combination over any date range.
  • `run_realtime_report` — the last 30 minutes of activity.
  • `run_funnel_report` — multi-step funnel analysis.
  • `list_google_ads_links` — the Google Ads accounts linked to a property.
Setup

It runs on Python 3.10+ and is published to PyPI as analytics-mcp, so pipx run analytics-mcp needs no install step. Before it will do anything you have to enable both the Google Analytics Admin API and the Google Analytics Data API in a Google Cloud project, then configure Application Default Credentials — either an OAuth client or an impersonated service account — with the https://www.googleapis.com/auth/analytics.readonly scope.

Worth knowing

Google labels this experimental, so expect the tool surface to move. The read-only scope is a genuine safety property rather than a limitation: this server can report on your analytics but cannot reconfigure the property, which makes it one of the more comfortable production integrations to hand an agent. Apache-2.0 licensed.

Related MCP Servers

MCP: Tableau MCP

by Tableau

New

Tableau's own MCP server — query published data sources, explore workbooks and views, and render live vizzes inside an AI client.

Browse all MCP servers →