Is the Google Analytics MCP server safe? What it can reach
What the Google Analytics MCP server can read, write and delete, how it signs in, and how to limit it in Claude Code and Codex.
Google’s official analytics-mcp server runs locally through pipx and signs in with Google Application Default Credentials. By default it is read-only: reports and property details. Three write tools stay off until you pass the --allow-write flag and grant the analytics.edit scope.
Who maintains it
| Implementation | Kind | Status |
|---|---|---|
| googleanalytics/google-analytics-mcp (analytics-mcp) | Official | active |
It runs as a local process on your machine or as a hosted remote server.
How it signs in
Google Application Default Credentials for a user or an impersonated service account with access to your Analytics properties. The server acts with that identity. A hosted HTTP mode with end-user OAuth is also documented.
| Scope or permission | Access |
|---|---|
https://www.googleapis.com/auth/analytics.readonly | read |
https://www.googleapis.com/auth/analytics.edit | write |
What its tools can do
| Kind | Tools |
|---|---|
| Read | get_account_summaries, get_property_details, list_google_ads_links, list_property_annotations, list_key_events, run_report, run_funnel_report, run_conversions_report, get_custom_dimensions_and_metrics, run_realtime_report |
| Write | create_property_annotation, create_custom_dimension, create_key_event |
| Can’t be undone | none documented |
The three write tools are available only with --allow-write (or ANALYTICS_MCP_ALLOW_WRITE) and the analytics.edit scope. create_custom_dimension needs the Editor role on the property and create_key_event needs Marketer or Editor. The README lists no delete tools.
Built-in limits
| Option | What it does |
|---|---|
--allow-write | Off by default. Adds the tools that create or change Analytics resources. Also set with ANALYTICS_MCP_ALLOW_WRITE. |
analytics.readonly scope only | Credentials limited to the read-only scope cannot use the write tools even if the flag is on. |
Service account impersonation | Run ADC through an impersonated service account that has Viewer access on only the properties you want. |
--transport http with --oauth | For a hosted multi-tenant server, each user signs in with their own Google account. |
The risks
- Reports return page paths, event parameters and audience data into the model’s context, and attacker-controlled values such as UTM tags and page titles can carry injected text.
- With --allow-write, an injected instruction can add custom dimensions, key events or annotations to a live property, which changes reporting for everyone who uses it.
- The credentials file is a long-lived Google credential on disk, and it covers every property the signed-in user can open.
- The hosted HTTP mode is documented with --allow-unauthenticated at the Cloud Run layer, so the Bearer token check in analytics-mcp is the only gate.
Limit it in Claude Code
Add it from the documented launch settings, at local or user scope so a token never lands in a shared .mcp.json:
claude mcp add --env GOOGLE_APPLICATION_CREDENTIALS=... --env GOOGLE_CLOUD_PROJECT=... analytics -- pipx run analytics-mcpClaude Code names MCP tools mcp__analytics__<tool>. Deny rules win over ask rules, and ask rules over allow rules. Put these in ~/.claude/settings.json or the project’s .claude/settings.json:
{
"permissions": {
"ask": [
"mcp__analytics__create_property_annotation",
"mcp__analytics__create_custom_dimension",
"mcp__analytics__create_key_event"
]
}
}Limit it in Codex
Codex reads MCP servers from ~/.codex/config.toml. disabled_tools removes tools, and enabled_tools keeps only the ones you list:
[mcp_servers.analytics]
command = "pipx"
args = ["run", "analytics-mcp"]
env_vars = ["GOOGLE_APPLICATION_CREDENTIALS", "GOOGLE_CLOUD_PROJECT"]Checklist
- Leave --allow-write off unless you need to change a property.
- Authorize with the analytics.readonly scope only.
- Use a service account with Viewer access on the properties in scope.
- Keep the credentials file out of the repo.
- Review any custom dimension or key event the agent creates.
Checked against the vendor documentation on November 25, 2026. googleanalytics/google-analytics-mcp README · google-analytics-mcp README (raw)
What Excellent covers
Excellent doesn’t inspect MCP servers themselves. Its free scan reads supported logs on the Mac (Claude Code, Codex, Grok Build, GitHub Copilot CLI, Gemini CLI and Qwen Code) and reports findings for review, so you can see what an agent did after a session. Run the free scan · See a sample report · How to vet any MCP server
Excellent Pro adds checks before supported actions. Claude Code can display an ask prompt. With Codex, an Excellent “ask” refuses the action and tells the agent to ask you. Pro is US-only for now. Agent coverage · Pricing