About this project

Google Analytics 4 (GA4) MCP Server is a Model Context Protocol server that provides AI agents with direct, analysis-ready access to GA4 properties. It eliminates manual data wrangling by offering schema discovery, server-side metric aggregation, and safe defaults out of the box. The server can be installed via a one-line universal installer that auto-configures popular MCP clients such as Claude Desktop, Cursor, Claude Code, VS Code (Cline/Roo Code/Continue), Zed, and Windsurf. It is also available as a Python package on PyPI and an npm package under the scope `@surendranb`. Available tools include running multi-dimensional GA4 reports with automated totals, listing accounts and properties, fetching complete dimension and metric schemas, querying real-time active users and event counts, and searching built-in analytical skills. Dynamic skills are loaded from GitHub and cover traffic-diagnosis, channel-acquisition, ecommerce-analysis, and ai-referral-analysis (tracking ChatGPT, Claude, Perplexity, and Gemini referral traffic). Authentication requires a Google service account JSON file and a GA4 property ID, configured either through environment variables or client-specific config files. The package collects anonymous, non-PII telemetry by default, which can be disabled via `DO_NOT_TRACK=1` or `MCP_TELEMETRY_OPT_OUT=1`. License: MIT.