Google AnalyticsSAFE
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.
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
Model Context Protocol (MCP) server for Google Analytics 4: real-time query exploration, schema discovery, metric aggregation, and audience insights for AI agents.
[](https://github.com/surendranb/google-analytics-mcp/actions) [](https://pypi.org/project/google-analytics-mcp/) [](https://www.npmjs.com/package/@surendranb/google-analytics-mcp) [](https://scorecard.dev/viewer/?site=github.com/surendranb/google-analytics-mcp) [](LICENSE)
🌐 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": {
"dde96ea7c39aOBSERVED · 2026-10-06Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.
claude mcp add google-analytics-mcp --env GOOGLE_APPLICATION_CREDENTIALS=${GOOGLE_APPLICATION_CREDENTIALS} -- None google-analytics-mcp==2.11.5Exposed tools (11)
11 read · 0 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
check_for_updates | read | Check PyPI for newer versions of google-analytics-mcp. |
get_dimensions_by_category | read | |
get_ga4_data | read | |
get_metrics_by_category | read | |
get_property_schema | read | |
get_troubleshooting_guide | read | |
list_dimension_categories | read | |
list_metric_categories | read | |
list_properties | read | |
search_schema | read | |
search_skills | read |
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- declared (5 observation(s))
- Shell
- none-observed
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (6)
<strong>Ephemeral Relay Only:</strong> During 1-Click Browser Sign-in, Google redirects an authorization code to our gateway (<code>ga4-gateway.reachsuren.workers.dev</code>). The gateway executes an
mcp
curl -fsSL "https://ga4.builditwithai.xyz/install" | bash
curl -fsSL "https://ga4.builditwithai.xyz/install" | bash
curl -fsSL "https://ga4.builditwithai.xyz/?src=setup" | bash
- Curl: `curl -fsSL https://ga4.builditwithai.xyz/install | bash`
Gates applied: no_behavioural_pass.
dde96ea7c39afull audit observations/trust-audit/mcp-server/surendranb__google-analytics-2.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-06 | dde96ea7c39a | SAFE | B | 89 | first audit |
Questions
What is the 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.
What tools does Google Analytics expose?
11 in total: 11 read-only, 0 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is Google Analytics safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B.
What credentials does Google Analytics need?
It reads GOOGLE_APPLICATION_CREDENTIALS from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.
How does Google Analytics run?
It speaks stdio, so it runs as a local process your client starts. It is published on npm as @surendranb/google-analytics-mcp at 2.11.5.
How current is this page?
The grade is for one exact copy of the source (dde96ea7c39a), read on 2026-10-06. The repository is watched and re-audited when it changes.