Google AnalyticsCAUTION
Model Context Protocol server for Google Analytics, enabling LLMs to fetch and analyze web analytics data
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
[](https://mseep.ai/app/ruchernchong-mcp-server-google-analytics)
[](https://mseep.ai/app/41973db2-3e96-4d8b-b138-265f40fd5bab)
[](https://smithery.ai/server/mcp-server-google-analytics)
An MCP server implementation for accessing Google Analytics 4 (GA4) data, built using the Model Context Protocol TypeScript SDK.
Features
- Get page view metrics with customizable dimensions
- Track active and new users over time
- Analyze specific events and their metrics
- Monitor user behavior metrics (session duration, bounce rate)
- Flexible date range selection for all queries
Prerequisites
- Node.js 20 or higher
- A Google Analytics 4 property.
- A Google Cloud project with the Analytics Data API enabled.
- A service account with credentials to access the API.
Setup and Configuration
To use this server, you need to configure authentication with Google Analytics. This is done using a service account.
1. Enable the Google Analytics Data API
- Go to the Google Cloud Console.
- Select the project you want to use.
- In the navigation menu, go to APIs & Services > Library.
- Search for "Google Analytics Data API" and enable it.
2. Create a Service Account
- In the Google Cloud Console, navigate to IAM & Admin > Service Accounts.
- Click "Create Service Account".
- Give the service account a name (e.g., "GA4 MCP Server").
- Click "Create and Continue".
- You can skip granting the service account access to the project.
- Click "Done".
- Find the service account you just created and click on the three dots under "Actions".
- Select "Manage keys", then "Add Key" > "Create new key".
- Choose JSON as the key t
f7c40d344eb7OBSERVED · 2026-10-07Connect
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 mcp-server-google-analytics --env GOOGLE_PRIVATE_KEY=${GOOGLE_PRIVATE_KEY} -- npx -y [email protected]{
"mcpServers": {
"mcp-server-google-analytics": {
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"GOOGLE_PRIVATE_KEY": "${GOOGLE_PRIVATE_KEY}"
}
}
}
}Exposed tools (5)
4 read · 1 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
getActiveUsers | read | Get active users metrics for a specific date range |
getEvents | read | Get event metrics for a specific date range |
getPageViews | read | Get page view metrics for a specific date range |
getUserBehavior | read | Get user behavior metrics like session duration and bounce rate |
runReport | write | Run a report to get analytics data |
Trust audit
CAUTIONgrade C · trust 79/100 Install with care. The audit found things worth knowing before you trust its output.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | FAIL |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (3)
6. Assign the **"Viewer"** role. You do not need to notify the user.
.releaserc.json
@google-analytics/data, @modelcontextprotocol/sdk, dotenv, googleapis, @biomejs/biome, @commitlint/cli, @commitlint/config-conventional, @semantic-release/changelog
Gates applied: instruction_override, no_behavioural_pass.
f7c40d344eb7full audit observations/trust-audit/mcp-server/ruchernchong__google-analytics.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-07 | f7c40d344eb7 | CAUTION | C | 79 | first audit |
Questions
What is the Google Analytics MCP server?
Model Context Protocol server for Google Analytics, enabling LLMs to fetch and analyze web analytics data
What tools does Google Analytics expose?
5 in total: 4 read-only, 1 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?
With care. The audit graded it C (79/100) and found 3 things worth knowing before you trust this server, listed below with the exact line each was found on.
What credentials does Google Analytics need?
It reads GOOGLE_PRIVATE_KEY 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 mcp-server-google-analytics at 1.1.0.
How current is this page?
The grade is for one exact copy of the source (f7c40d344eb7), read on 2026-10-07. The repository is watched and re-audited when it changes.