Skip to main content
Glama
surendranb

Google Analytics MCP Server

by surendranb

Google Analytics 4 (GA4) MCP Server 📊

Model Context Protocol (MCP) server for Google Analytics 4: real-time query exploration, schema discovery, metric aggregation, and audience insights for AI agents.

CI PyPI version npm version OpenSSF Scorecard License: MIT

🌐 Live Documentation & Web Portal: https://ga4.builditwithai.xyz


⚡ Quickstart

# 1-Line Universal Installer (Auto-configures Claude Desktop, Cursor, Claude Code, Antigravity, VS Code, Zed, Windsurf)
curl -fsSL "https://ga4.builditwithai.xyz/install" | bash

# Or run directly via your preferred runtime:
uvx google-analytics-mcp
uvx --from google-analytics-mcp ga4-mcp-server
python -m ga4_mcp
npx -y @surendranb/google-analytics-mcp


Related MCP server: GA4 MCP Server

🤖 Client Setup

A. Claude Code (CLI)

claude mcp add google-analytics -- uvx google-analytics-mcp

B. Cursor & Google Antigravity (mcp.json)

{
  "mcpServers": {
    "google-analytics": {
      "command": "uvx",
      "args": ["google-analytics-mcp"]
    }
  }
}

C. Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "google-analytics": {
      "command": "uvx",
      "args": ["google-analytics-mcp"],
      "env": {
        "GA4_PROPERTY_ID": "your_ga4_property_id",
        "GOOGLE_APPLICATION_CREDENTIALS": "/path/to/service_account.json"
      }
    }
  }
}

D. VS Code (Cline / Roo Code / Continue)

{
  "mcpServers": {
    "google-analytics": {
      "command": "npx",
      "args": ["-y", "@surendranb/google-analytics-mcp"]
    }
  }
}

🛠️ Tools & Capabilities

Tool Name

Parameters

Description

Return Type

get_ga4_data

dimensions (list), metrics (list), date_ranges (list), limit (int)

Runs multi-dimensional GA4 reports with automated metric totals and server-side aggregation.

JSON / Markdown

list_accounts

(none)

Lists all accessible Google Analytics accounts and permission levels.

JSON

list_properties

account_id (optional)

Lists all GA4 properties associated with an account.

JSON

get_property_metadata

property_id (optional)

Fetches complete dimension and metric schemas, custom definitions, and compatibility rules.

JSON

run_realtime_report

metrics (list), dimensions (list)

Queries real-time active users and event counts from the last 30 minutes.

JSON

search_skills

query (string)

Searches built-in GA4 analytical playbooks (e-commerce, channel attribution, bot filtering).

Markdown

skill_read

skill_name (string)

Dynamically loads procedural skills and analytical guides from GitHub.

Markdown

skills_list

(none)

Lists all available live GA4 analytical skills.

JSON


🧠 Dynamic Skills & Guided Playbooks

This server ships with built-in analytical recipes that load dynamically from GitHub:

  • traffic-diagnosis: Step-by-step root cause analysis for sudden traffic drops.

  • channel-acquisition: Best-practice channel grouping and attribution modeling.

  • ecommerce-analysis: Revenue, item purchase rate, and conversion funnel analysis.

  • ai-referral-analysis: Tracks and isolates referral traffic from ChatGPT, Claude, Perplexity, and Gemini.


🔒 Telemetry & Privacy

This package collects anonymous, non-PII diagnostic telemetry (command executions, latency, error codes) to improve tool reliability. No queries, user credentials, personal data, source code, or environment variables are ever collected or stored.

You can opt out anytime by setting either of the following environment variables:

export DO_NOT_TRACK=1
# or
export MCP_TELEMETRY_OPT_OUT=1

📄 License

MIT License. See LICENSE for details.

Install Server
A
license - permissive license
A
quality
B
maintenance

Maintenance

Maintainers
Response time
3dRelease cycle
44Releases (12mo)
Commit activity
Issues opened vs closed

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Enables LLM applications to query Google Analytics 4 data through standard MCP interfaces, supporting real-time data, custom reports, and metadata discovery.
    5
    185
    1
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Connects MCP clients like Claude Desktop to Google Analytics 4 Data API, enabling natural language queries for reports, top pages, traffic sources, conversions, realtime users, and period comparisons.
    7
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables querying Google Analytics 4 data using natural language through MCP clients like Claude and Cursor, supporting 200+ dimensions and metrics for traffic, user behavior, and e-commerce analysis.
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables interactive Google Analytics 4 visualizations inside Claude conversations, supporting ad-hoc queries with line, bar, pie charts and data tables.

View all related MCP servers

Related MCP Connectors

  • GA4 conversion analyst inside Claude — funnel drops, traffic anomalies, device gaps, with numbers.

  • Connect your team's living knowledge base — docs, data, issues, CRM — to Claude and ChatGPT.

  • Connect e-commerce and marketing data to AI assistants via MCP.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/surendranb/google-analytics-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server