Back to blog

Engineering · Jun 5, 2026

MCP Spotlight: Google Analytics MCP — Ask Your Agent "What Happened on the Site Today?"

Google's official MCP server gives AI agents direct access to GA4 data — account discovery, standard reports, funnel analysis, and realtime metrics — all authenticated via Application Default Credentials. Seven tools, one pipx install, and the signal that MCP has arrived.

MCP ServerGoogle AnalyticsGoogleGA4AnalyticsAI Agents

MCP Spotlight: Google Analytics MCP — Ask Your Agent "What Happened on the Site Today"

Server: analytics-mcp by Google License: Apache 2.0 · Tools: 7 · Language: Python 3.10+ · Status: Experimental MCP Tracker: glama.ai/mcp/servers/googleanalytics/google-analytics-mcp GitHub: googleanalytics/google-analytics-mcp

Google Analytics has been a dashboard product since 2005. You click through menus, build report configurations, export CSVs. Your AI agent has never been able to participate in that workflow — until now.

Google's official MCP server — marked experimental but shipping from the googleanalytics GitHub org — gives AI agents direct access to GA4 data through the Data API and Admin API. Seven tools, authenticated via Application Default Credentials, installed in one pipx command.

The Significance: Google Ships MCP

This matters beyond the feature set. Google publishing an MCP server under their official org signals that MCP has crossed a threshold — it's no longer a community protocol, it's something big tech is building first-party tooling for. Combined with Microsoft's Playwright MCP (which has 5.3M+ downloads), the pattern is clear: first-party MCP servers are becoming table stakes.

The Seven Tools

ToolAPIWhat It Does
get_account_summariesAdmin APILists all GA4 accounts and properties the user can access
get_property_detailsAdmin APIReturns full details about a specific property
list_google_ads_linksAdmin APIShows which Google Ads accounts are linked to a property
run_reportData APIRuns a standard GA4 report with dimensions and metrics
run_funnel_reportData APIRuns a funnel analysis report
run_realtime_reportData APIQueries live data from the last 30 minutes
get_custom_dimensions_and_metricsAdmin APIRetrieves all custom dimensions and metrics configured for a property

The tool set covers the core GA4 interaction surface: discovery (which accounts and properties exist), configuration (what custom dimensions are available), and reporting (standard, realtime, and funnel).

Authentication: ADC, Not API Keys

Google Analytics MCP uses Application Default Credentials (ADC) — the same authentication model as every other Google Cloud tool. No API key strings to paste into config files:

# Authenticate once with Google Cloud
gcloud auth application-default login \
  --scopes https://www.googleapis.com/auth/analytics.readonly,https://www.googleapis.com/auth/cloud-platform

# Credentials saved to: ~/.config/gcloud/application_default_credentials.json
# The MCP server picks this up automatically via GOOGLE_APPLICATION_CREDENTIALS

This is important for two reasons. First, ADC supports service account impersonation — your CI pipeline can use a service account without sharing user credentials. Second, it means the authentication surface is identical to what your team already uses for Google Cloud. No new secrets to manage.

Facio Integration

Python-based MCP servers work through stdio transport. For Facio:

{
  "mcpServers": {
    "analytics-mcp": {
      "command": "pipx",
      "args": ["run", "analytics-mcp"],
      "env": {
        "GOOGLE_APPLICATION_CREDENTIALS": "/path/to/adc.json",
        "GOOGLE_CLOUD_PROJECT": "your-project-id"
      }
    }
  }
}

The ADC credentials file can be provisioned via gcloud auth application-default login (user credentials) or created as a service account key and supplied through Facio's credential store:

{
  "env": {
    "GOOGLE_APPLICATION_CREDENTIALS": "${credentials.GA_ADC_CREDENTIALS_PATH}",
    "GOOGLE_CLOUD_PROJECT": "${credentials.GCP_PROJECT_ID}"
  }
}

Facio's audit trail captures every report run alongside the agent's reasoning. For marketing teams reviewing AI-generated insights, this means every data query is traceable: which property, which date range, which dimensions and metrics, and what the agent concluded from the results.

Quickstart

# Prerequisites
# 1. Python 3.10+
# 2. Install pipx: https://pipx.pypa.io/stable/#install-pipx
# 3. Google Cloud project with Analytics Admin API and Data API enabled
# 4. Authenticate with gcloud (see above)

# Add to Gemini CLI
# Edit ~/.gemini/settings.json:
{
  "mcpServers": {
    "analytics-mcp": {
      "command": "pipx",
      "args": ["run", "analytics-mcp"],
      "env": {
        "GOOGLE_APPLICATION_CREDENTIALS": "~/.config/gcloud/application_default_credentials.json",
        "GOOGLE_CLOUD_PROJECT": "your-project-id"
      }
    }
  }
}

# First prompts after connection:
# "What Google Analytics properties do I have access to?"
# "What are the most popular events in my GA4 property in the last 90 days?"
# "Run a funnel report showing the checkout flow — how many users drop off at each step?"
# "Were most of my users in the last 6 months logged in?"
# "What custom dimensions and metrics are configured in my property?"

A YouTube setup tutorial walks through the full configuration.

Use Cases

Conversational analytics: Instead of "let me check GA4 and get back to you," your agent answers immediately: "Unique visitors are up 12% week-over-week, driven by organic search from the blog post we published Tuesday. Realtime shows 47 active on the pricing page right now."

Funnel debugging by AI: Agent runs run_funnel_report on your checkout flow, identifies a 40% drop at the shipping step, cross-references with session recordings from another tool, and proposes a hypothesis — all in one conversation.

Campaign reporting: Agent queries list_google_ads_links to find linked accounts, then runs GA4 reports segmented by campaign and surfaces underperforming ads without a human building the report.

Realtime monitoring: Agent polls run_realtime_report and alerts when traffic patterns deviate: "Pricing page concurrent users just spiked 3× — could be a Product Hunt launch or a crawler. Want me to check?"

Custom dimension discovery: New team member asks: "What custom dimensions do we track?" Agent calls get_custom_dimensions_and_metrics and lists them with descriptions — no documentation needed.

Experimental Status: What That Means

Google marks this server as experimental. In practice this means:

  • The package is analytics-mcp on PyPI with active development
  • Tools may change as the API evolves
  • It currently targets Gemini CLI and Gemini Code Assist as primary clients
  • The Discord channel (🤖-analytics-mcp) is the support surface

The fact that it's experimental but shipping under the official googleanalytics org with proper PyPI packaging, YouTube tutorials, and Discord support suggests this is an early-stage but committed product, not a side project.

Bottom Line

Google Analytics MCP closes the gap between dashboards and agents. Seven tools, ADC-based authentication, Python 3.10+, and shipping under Google's official org. For any team running GA4, this turns "let me check analytics" from a context switch into a natural conversation with your agent.

The bigger story: when Google ships MCP tooling, the protocol has arrived.


MCP Spotlight is a series covering servers that give AI agents real capabilities. Every server is evaluated for tool quality, ecosystem significance, and integration fit with Facio's HITL-first agent runtime.