Google Analytics MCP: Google's official GA4 server, setup and what to ask it

Google publishes an official, read-only Google Analytics MCP server for GA4. This guide covers what it exposes (account summaries, property details, reports, real-time), how to authenticate with Google Cloud credentials, and the questions that make it useful for marketing teams.

Walma Engineering·Updated 12 September 2026·6 min read

GA4's interface is built for exploring, not for answering. "Did organic conversions on the pricing page go up after the redesign, compared with the same weeks last year" is four clicks per week in the UI or one sentence to an agent with the Analytics MCP server. Google's official server is read-only, well made, and quick to set up if you have a Google Cloud project. This guide covers it. Client setup is in Claude Code, Cursor and Claude Desktop.

What the official server exposes

Google's server is a Python package that wraps two APIs:

  • Admin API: account summaries (which accounts and properties the credential sees), property details, custom dimensions and metrics.
  • Data API: run_report with dimensions, metrics, date ranges and filters, and run_realtime_report for the last 30 minutes.

That is enough for every reporting question. It does not write, so the agent cannot change streams, events or settings.

Setup

  1. Google Cloud project. Enable the Google Analytics Data API and the Google Analytics Admin API.
  2. Credentials. The server uses Application Default Credentials. For yourself, run gcloud auth application-default login with a Google account that has at least Viewer on the GA4 property. For a team or server, create a service account, add its email to the GA4 property as Viewer, and point GOOGLE_APPLICATION_CREDENTIALS at its key file.
  3. Install the server per the README (a pipx or uv install).
  4. Add it to your client. For Claude Code:
claude mcp add --transport stdio ga4 \
  -e GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json \
  -- <command that starts the analytics server>

Start a session, /mcp, and ask it to list account summaries. If you see your properties, you are done.

What to ask

Give the agent the property ID once, then:

  • "Sessions and conversions by default channel group for the last 28 days versus the previous 28."
  • "Top 20 landing pages by organic sessions this month, with conversion rate and the change from last month."
  • "Which campaigns (session campaign) drove purchases in the last 90 days, ranked by revenue?"
  • "Active users right now, by country and page."
  • "Engagement rate by device for the checkout funnel pages."

The model needs to know your custom dimensions and events to use them; ask it to fetch property details first, or put them in a skill so every session starts informed.

The three-server combination

GA4 tells you what visitors did. Search Console tells you what Google showed and what got clicked. Google Ads tells you what you paid for. With all three connected, one session answers "which queries and campaigns produced the sessions that converted, and what did they cost" without a data engineer.

Add Ahrefs for what you could rank for, and you have the data side of an SEO agent. The procedures, the monthly review and the weekly brief, are the skill side.

Running it for a team

A service-account key with Viewer on every property is a modest risk compared with an ads or CRM credential, but it still should not live on laptops. In a team setup it lives in a gateway that exposes the server to approved users and logs each query.

Walma AI Hub runs the Analytics server next to Search Console, Google Ads and Ahrefs inside the customer's own EU region, with one policy and one log across Claude, GPT and the agents built on them. Book a walkthrough if you want the three-server setup for your marketing team.

Frequently asked questions

Is there an official Google Analytics MCP server?+

Yes. Google publishes an official server for Google Analytics 4 on GitHub under the googleanalytics organisation. It is read-only and exposes account and property information, standard reports through the Data API, and real-time reports.

How do I set up the GA4 MCP server?+

Enable the Google Analytics Data API and Admin API in a Google Cloud project, authenticate with Application Default Credentials (your own Google login or a service account that has Viewer access on the GA4 property), install the server, and add it to your MCP client.

Can an AI agent change my Google Analytics settings through MCP?+

Not with the official server; it only reads. Configuration changes go through the Admin API or the UI.

What can an agent report from GA4 through MCP?+

Anything the Data API can: sessions, users, conversions and revenue by any dimension (source, medium, campaign, landing page, device, country) and date range, plus real-time active users. Combined with Search Console and Google Ads it can trace traffic from query to conversion.

Walma AI Hub

The same tools, in your EU region, under your control

A 20-minute walkthrough with an engineer. We map it to your tools, your MCP servers and your budget model.

About AI Hub