Skip to main content

Google Analytics MCP Logo

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://ga4mcp.com/


⚡ 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


🤖 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.

Metadata

Release files for google-analytics-mcp 2.11.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for google-analytics-mcp 2.11.7
File Size Uploaded Provenance Actions
google_analytics_mcp-2.11.7.tar.gz 56.1 kB Without provenance Details for google_analytics_mcp-2.11.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for google-analytics-mcp 2.11.7
File Interpreter ABI Platform Actions
google_analytics_mcp-2.11.7-py3-none-any.whl Python 3 none any Details for google_analytics_mcp-2.11.7-py3-none-any.whl

Total release size: 110.6 kB

Release files / google_analytics_mcp-2.11.7.tar.gz

Download URL google_analytics_mcp-2.11.7.tar.gz
Size 56.1 kB
Tags Source
SHA-256 checksum
How to use checksums
507a3a3374d0464fd61753460b5ffd719cf83756329cd0c5910ac6f84cc0cb76
BLAKE2b-256 checksum
How to use checksums
7f8e4c499c8d873ae6a95a70535791e4b9bff8892ede6cbbfcb6892b89fc5397
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / google_analytics_mcp-2.11.7-py3-none-any.whl

Download URL google_analytics_mcp-2.11.7-py3-none-any.whl
Size 54.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b2f2aaa4301ac2b8cc33f57693fc55f45ecded1e7b42198ebd25975b3f555db
BLAKE2b-256 checksum
How to use checksums
932939d31a562ca3112d66fbdb7a575c3a55b5330bfc4c45d33eee2eab6b2328
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for google-analytics-mcp 2.11.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.11.7 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page