Google Analytics MCP Server
@surendranb
About Google Analytics MCP Server
Google Analytics 4 data to AI agents, agentic workflows, and MCP clients. Give agents analysis-ready access to website traffic, user behavior, and performance data with schema discovery, server-side aggregation, and safe defaults that reduce data wrangling.
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"ga4-analytics": {
"command": "npx",
"args": [
"-y",
"google-analytics-mcp"
],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "",
"GA4_PROPERTY_ID": ""
}
}
}
}Tools
No tools detected
Fetch the live tool list by running this server in a temporary sandbox using the button above.
Overview
What is Google Analytics 4 MCP Server?
Google Analytics 4 MCP Server connects GA4 data directly to AI agents and MCP runtimes across Claude, ChatGPT, Gemini, Cursor, VS Code, and OpenClaw. It provides analysis-ready access with live schema discovery, metric auto-aliasing, server-side aggregation, and autonomous self-healing defenses.
How to use Google Analytics 4 MCP Server?
Install the server using the universal one‑line installer, Homebrew, npx, uvx, or pip. Configure it by setting GOOGLE_APPLICATION_CREDENTIALS (path to a service account JSON key) and GA4_PROPERTY_ID (numeric GA4 property ID) in your MCP client’s environment variables. Then invoke the server via your MCP runtime to access GA4 tools.
Key features of Google Analytics 4 MCP Server
- Autonomous self-healing that intercepts schema hallucinations
- Metric auto‑aliasing maps legacy names to GA4 terms
- Server‑side aggregation computes property totals dynamically
- Data volume protection limits queries over 2,500 rows
- Multi‑platform support (npm, PyPI, Homebrew, Gemini CLI, OpenAPI)
- Six ready‑to‑use tools for querying and exploring GA4 schemas
Use cases of Google Analytics 4 MCP Server
- Let an AI analyst answer natural‑language questions about GA4 data
- Enable a coding assistant to query GA4 metrics during development
- Automate GA4 report generation for recurring business reviews
- Let marketers explore GA4 schemas without leaving their chat interface
FAQ from Google Analytics 4 MCP Server
What prerequisites are needed to run the server?
You need a Google Cloud service account with a JSON key, the GA4 Data API enabled, and a GA4 property with the service account added as a Viewer.
How do I install the server?
Use the universal installer (curl -fsSL https://ga4.builditwithai.xyz | bash), Homebrew, npx, or uvx --from google-analytics-mcp ga4-mcp-server.
What tools does the server provide?
The server includes get_ga4_data, search_schema, get_property_schema, list_metric_categories, list_dimension_categories, and get_troubleshooting_guide.
Does the server collect telemetry?
Yes, anonymous usage telemetry (install, start, tool calls) is collected by default but can be opted out using DISABLE_TELEMETRY=1, GA_MCP_TELEMETRY=false, DO_NOT_TRACK=1, or NO_TELEMETRY=1. No credentials, PII, or report data are ever collected.
What clients or platforms are supported?
The server works with Claude Desktop, ChatGPT, Gemini CLI, Cursor, VS Code, OpenClaw, and any MCP‑compatible runtime.
Frequently asked questions
What prerequisites are needed to run the server?
You need a Google Cloud service account with a JSON key, the GA4 Data API enabled, and a GA4 property with the service account added as a Viewer.
How do I install the server?
Use the universal installer (`curl -fsSL https://ga4.builditwithai.xyz | bash`), Homebrew, npx, or `uvx --from google-analytics-mcp ga4-mcp-server`.
What tools does the server provide?
The server includes `get_ga4_data`, `search_schema`, `get_property_schema`, `list_metric_categories`, `list_dimension_categories`, and `get_troubleshooting_guide`.
Does the server collect telemetry?
Yes, anonymous usage telemetry (install, start, tool calls) is collected by default but can be opted out using `DISABLE_TELEMETRY=1`, `GA_MCP_TELEMETRY=false`, `DO_NOT_TRACK=1`, or `NO_TELEMETRY=1`. No credentials, PII, or report data are ever collected.
What clients or platforms are supported?
The server works with Claude Desktop, ChatGPT, Gemini CLI, Cursor, VS Code, OpenClaw, and any MCP‑compatible runtime.
Basic information
More Data & Analytics MCP servers

cloro
cloroExtract structured data from ChatGPT, Perplexity, Grok, Gemini, Google Search, Google News, Copilot, and AI Overview through one API, across all countries and states.
xverum mcp
Xverum-LLCFind and enrich the right people from 750M professional profiles. Search by role, seniority, skills, industry, and location in plain English. Pull profiles with work history, education, and seniority, then see who's like

DPF
DPF AdminDPF (Data Prompt Forge) is an AI-powered platform for data ingestion, transformation and analytics using natural language. Describe your data and the shape you want and the AI infers the schema and generates the pipeline
TEOS WARN Act Layoff Intelligence
TEOSSearch US WARN Act mass-layoff notices by state, employer, headcount, and effective date — 5,950 normalized filings across CA, TX, NY, IL, NC.

Rankbits
rankbitsAI visibility analytics across 15+ providers (ChatGPT, Perplexity, Gemini, AI Overviews, and more). The MCP connector lets assistants run scans, compare competitor mentions, and track your brand's visibility in AI answer
Comments