Google Analytics MCP server: connect Google Analytics to Claude or Codex
Google's official Google Analytics MCP server reaches Google Analytics through the Admin API and Data API — account structure, core reports, realtime. It is the right free answer for asking questions. This guide covers the setup, what changes when the MCP server can also configure Google Analytics, and the one Google Analytics modelling detail that makes an agent's answer wrong in a way that looks right.
What the official server gives you
Google's own Google Analytics MCP server connects an MCP client to Google Analytics via the Admin API (accounts, properties, data streams) and the Data API (core reports and realtime). For "what happened on the site last week, broken down by channel", that is the whole job and it costs nothing.
What a full MCP server adds
The Google Analytics write half is smaller than the Google Ads one and it matters for a different reason: most Google Analytics pain is configuration, not reporting. Creating a conversion event, adding a custom dimension, or linking a Google Ads account are the changes people actually need, and they are exactly the ones a read-only server leaves you to do by hand.
| Official Google Analytics MCP | Agent Planners MCP | |
|---|---|---|
| Google Analytics tools | Reporting + admin reads | 30 reads, 27 writes |
| Writes | None | Custom dimensions, conversion events, audiences, data streams, Ads links |
| Approval before a write | n/a | Queued for approval or run inside the guardrails, as the key's write mode says — audited unless an admin turns off that key's call log |
| Joined to ad spend in one session | No | Google Ads, Meta, TikTok, DV360 on the same key |
| Joined to your warehouse | No | BigQuery on the same key |
How to configure it
- 1Create a key in API & MCP.
tools:readfor questions; addtools:writeif the agent should be able to change Google Analytics configuration. - 2Connect Google Analytics under Integrations. One authorization now grants both read and write scopes — before this, an ordinary re-authorize silently downgraded write access back to read-only.
- 3Add the server to your client with the snippet below.
- 4Start with
describe_permissions, thenlist_accountsfor the property ids.
claude mcp add --transport http agent-plannershttps://www.agentplanners.com/api/mcp \
--header "Authorization: Bearer ap_live_…"The Google Analytics trap that makes an agent confidently wrong
Google Analytics' firstUser* dimensions are user-scoped and attributed to a first touch; the unprefixed versions are session-scoped. Both are correct and they answer different questions, so a report that mixes them produces numbers that never reconcile — and nothing in the API objects, because nothing is invalid.
There is a second one in the same family: conversions and keyEvents are the same metric under two names, and requesting both in one call is a deterministic API error rather than a duplicate column. A tool that collapses the alias before calling saves a round trip; one that does not hands the model an error to reason about.
Use cases
- Ad spend against Google Analytics outcomes in one question, because both families are on the same key — the join that a Google Analytics-only server structurally cannot do.
- A/B test analysis broken down by device, traffic source and new versus returning, which is what one reviewer described using it for.
- Conversion-event and custom-dimension setup as a change the agent proposes and you approve, rather than a checklist you work through in the Google Analytics UI.
- Reconciling Google Analytics against BigQuery, on the same key, when the two disagree.
Frequently asked questions
- Is there an official Google Analytics MCP server?
- Yes — Google ships a Google Analytics MCP server that reaches Google Analytics through the Admin API and Data API, covering account structure, core reports and realtime data. It is read-oriented.
- Can an MCP server change my Google Analytics configuration?
- The official one does not. Agent Planners exposes 27 Google Analytics writes — custom dimensions and metrics, key events, audiences, custom channel groups, event create rules, enhanced measurement, attribution, web data streams, Google Ads links, data retention and property settings — each queued for approval or run inside the guardrails, as the key's write mode says, and each recorded in the audit log.
- Why do my Google Analytics numbers change depending on the dimension I pick?
- The firstUser* dimensions are user-scoped and attributed to a first touch, while the unprefixed versions are session-scoped. Both are valid and they answer different questions, so mixing them in one report gives numbers that cannot reconcile.
- Can one MCP session read Google Analytics and my ad accounts together?
- On a single-platform server, no. On this one, Google Analytics sits alongside Google Ads, Meta, TikTok, DV360, Search Console and BigQuery on the same key — which is what makes joining spend to outcomes a single question.