Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface
GA4 MCP server for agent analytics
This repository provides an MCP server that exposes Google Analytics 4 data to AI agents and other MCP clients. It supports schema discovery, multi-dimensional reports, realtime queries, and built-in analytical playbooks for common GA4 questions.
Builders who want their agent to pull GA4 traffic and behavior data directly into their workflow.
You can ask an agent to analyze website performance with live GA4 data instead of exporting reports by hand.
What it does
GA4 report queries
Runs multi-dimensional GA4 reports with `get_ga4_data`, including date ranges, metrics, dimensions, and server-side aggregation.
Property and schema discovery
Lists accounts and properties, then fetches available dimensions, metrics, custom definitions, and compatibility rules.
Realtime analysis
Queries active users and event counts from the last 30 minutes with `run_realtime_report`.
Built-in analytical skills
Searches and loads guided playbooks such as traffic diagnosis, channel acquisition, ecommerce analysis, and AI referral analysis.
MCP client setup helpers
Includes install and config paths for Claude Code, Cursor, Claude Desktop, VS Code-based clients, and other MCP clients.
How to get it
- 1Run
# 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
- 2Run
claude mcp add google-analytics -- uvx google-analytics-mcp
README
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.
π 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
π€ 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.
Files in the repo
- .claude-plugin
- .github
- .well-known
- assets
- docs
- Formula
- ga4_mcp
- gemini-extension
- npm
- plugins
- scripts
- skills
- tests
- .gitignore
- AGENTS.md
- CHANGELOG.md
- claude-config-template.json
- gemini-extension.json
- LICENSE
- llms.txt
- logo.png
- netlify.toml
- pyproject.toml
- README.md
- RELEASING.md
- requirements.txt
- SECURITY.md
- server.json
- smithery.yaml
- test_cases.md
- uv.lock
Discussion (0)
Ask about usage, or say what you built with itSign in to join the discussion.
No comments yet. Be the first to say what this is good for.
More connectors
High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph β average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

Universal provider proxy for OpenAI Codex & Claude Code β use any LLM (Claude, Gemini, Grok, DeepSeek, Ollamaβ¦) with Codex CLI, App, SDK, and Claude Code
Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300Β΅s in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.
Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.
Stop your AI from making things up β it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.