Skip to content

Google Analytics MCP: how to set it up, and what it reads

Google's own MCP server lets Claude, Gemini and other AI tools read your GA4 reports. How to set it up step by step, what it can and can't read, and how to ask about your site with no Google Cloud project.

Portrait of Leon Missoul

Leon Missoul6 min read · Published 1 Dec 2026

  • The Google Analytics MCP server is Google's open-source connector between GA4 and AI tools such as Claude and Gemini. It runs on your own computer and, set up as Google describes, it only reads.
  • Setting it up takes five steps: install pipx, switch on the Analytics Admin and Data APIs in a Google Cloud project, sign in with gcloud using the read-only scope, set a quota project, and add the server to your AI tool.
  • It reads GA4's reports: standard, realtime, funnel and conversions reports, plus your property's settings. It has no tool for path explorations, saved explorations or one visitor's visits.
  • Orbit's MCP needs no Google Cloud project. Paste one address into Claude or ChatGPT, sign in, and ask about visits, funnels, paths and every person's visits. It comes with Launchpad, free on every site.

What is the Google Analytics MCP server?

MCP, the Model Context Protocol, is the open standard AI tools use to connect to other apps. The Google Analytics MCP server is Google's connector for GA4. Once it's added, an AI tool such as Claude or Gemini reads your Analytics data when you ask, instead of you pasting numbers into the chat.

Google publishes the code in the googleanalytics organisation on GitHub and documents the setup in its Analytics developer guide. In the setup Google's guide describes, the server runs on your own computer. Your AI tool starts it, and it uses your Google account's access, so it sees only the properties you can see.

Google's guide sets it up to read only. It can't create, change or delete anything in your property. The GitHub version can also create annotations, custom dimensions and key events, but only when you start it with --allow-write and sign in with the edit scope.

What you need before you start

  • Python 3.10 or newer, and pipx to run the server. Google's guide also works with uv.
  • A Google Cloud project where you can switch on APIs.
  • The Google Cloud CLI, gcloud, to sign in from a terminal.
  • The Viewer role or higher on the GA4 property you want to read.

How to set up the Google Analytics MCP server

These are the steps from Google's developer guide, read on 1 December 2026. Replace YOUR_PROJECT_ID with your Google Cloud project's ID. Google writes some commands over several lines; here each one is a single line, so it pastes into any terminal.

Step 1: install pipx

Follow the pipx installation guide for your system. pipx runs the server in its own space, so it doesn't touch your other Python tools.

Step 2: switch on the two Analytics APIs

Your project needs the Google Analytics Admin API, which lists your accounts and properties, and the Google Analytics Data API, which runs the reports.

Step 3: sign in with read-only access

This saves Application Default Credentials that the server uses to read Analytics as you.

If you sign in with an OAuth client file of your own, add --client-id-file=YOUR_CLIENT_JSON_FILE to the command. When it finishes, copy the path printed after "Credentials saved to file". That path is PATH_TO_CREDENTIALS_JSON in the next steps.

Step 4: set the quota project

With your own Google account, the API calls need a project to count against.

Step 5: add the server to your AI tool

Pick your tool below. Use absolute paths for the credentials file.

Use the Google Analytics MCP with Claude Desktop

Open claude_desktop_config.json. On a Mac it's in ~/Library/Application Support/Claude/, on Windows in %APPDATA%\Claude\. Add the server:

Restart Claude so it loads the server. If Claude can't find pipx, put pipx's full path in "command". Google suggests which pipx to find it.

Use it with Claude Code

Run this once in a terminal:

Use it with Gemini or Cursor

Google's developer guide now calls Gemini CLI deprecated and gives the setup for Antigravity: the same "analytics-mcp" block goes in ~/.gemini/config/mcp_config.json, or in .agents/mcp_config.json inside a project. The GitHub README still shows Gemini CLI, where the block goes in ~/.gemini/settings.json.

In Cursor, Google's guide runs the server with uvx instead. In .cursor/mcp.json the command is uvx and the arguments are --from analytics-mcp google-analytics-mcp.

Then ask a first question to check it works. Google's own examples include "How many users did I have yesterday?" and "What custom dimensions and custom metrics are configured in my property?"

What the GA4 MCP server can read

ToolWhat your AI tool gets
get_account_summariesYour Analytics accounts and properties
get_property_detailsOne property's details
list_google_ads_linksThe Google Ads accounts linked to a property
list_property_annotationsThe notes on a property's charts
get_custom_dimensions_and_metricsThe custom dimensions and metrics you set up
run_reportA standard report: any dimensions and metrics over any dates
run_realtime_reportWhat is happening on the site right now
run_funnel_reportA funnel report
run_conversions_reportAd costs, conversions, return on ad spend and attribution
The read tools in Google's developer guide and GitHub README, read on 1 December 2026.

That covers most questions you'd answer in GA4's standard reports: users, sessions, pages, sources, events and key events, broken down any way the reports allow. The GitHub version also lists your key events with list_key_events.

What it can't read

  • Path explorations and saved explorations. There is no tool for them, so the routes people take through your site stay in GA4's Explore screen.
  • One visitor's visits. The reports return totals and averages. GA4's user explorer, where you follow one person's sessions, has no tool.
  • Funnels further back than your retention setting. A standard property keeps user-level and event-level data for 2 or 14 months, and that setting limits funnel reports and explorations.
  • Endless questions. Every report spends Data API quota. A standard property gets 200,000 core tokens a day and 40,000 an hour, and a long chat with many large reports can run into it.

Common setup errors

Google lists the usual ones:

  • A 403 error means the APIs aren't switched on in your project, or your account doesn't have the Viewer role on the property.
  • A 403 that mentions insufficient scopes means you signed in without both scopes. Run the sign-in command from step 3 again.
  • The tool can't find pipx. Give pipx's full path in the config instead of the bare name.

Other analytics tools with an MCP server

Google isn't alone. Plausible launched an official MCP server on 30 November 2026, on every plan, read-only and without funnels; Plausible has no free plan. Simple Analytics has one on every plan, its free plan included. Matomo, PostHog, Mixpanel and Microsoft Clarity have official servers too, and Umami's starts on its paid Pro plan. What differs is what each one reads and what it takes to get there. The best web analytics tools puts them side by side.

Your site's analytics in Claude or ChatGPT, with no Google Cloud project

Orbit is free website analytics with an MCP server built in. You add Orbit's one-line script to your site. Then you paste https://mcp.goorbit.io into Claude, ChatGPT, Cursor, VS Code or Claude Code as a connector, sign in and click Allow. There's no Cloud project, no API key and nothing running on your computer. See how for Claude and ChatGPT.

Your AI tool can then read every number on every Analytics tab:

  • Visits, people, leads and time engaged, by way in, page, campaign, AI assistant, country or device, over any dates.
  • Funnels: the ones Orbit suggests from the routes people really took to a lead, and the ones you build. People on the site's team can also have their AI tool create and change funnels from the chat.
  • Paths: the routes people take from the way they came in to the lead.
  • Every person's visits, one by one, from the first visit to the lead.
  • People counted apart from AI agents and bots, with each AI assistant named as a way in.
Claude answering a question from a site's Orbit analytics, beside the tools it read.
Google Analytics MCPOrbit's MCP
SetupGoogle Cloud project, two APIs, gcloud sign-in, pipxPaste one address and sign in
Where it runsOn your computerHosted by Orbit
Reports and trendsYesYes
FunnelsFunnel reportsSuggested and your own, and it can build them
PathsNo toolYes
One visitor's visitsNo toolYes
Bots and AI agentsKnown bots removedCounted apart, in their own lanes
CostFreeFree on Launchpad
Read on Google's developer guide and GitHub README, 1 December 2026, and in Orbit.

Orbit starts counting the day its script goes on your site, and it can run beside GA4 while you compare. Its MCP comes with Launchpad, which is free on every site, with no card, no time limit and no traffic limit. More on your analytics in your AI tool, or see Orbit vs Google Analytics and the Google Analytics alternatives.

Start free, add the line to your site, and ask Claude about it as soon as the first visits come in.

Written by

  • Portrait of Leon Missoul

    Leon Missoul, Founder

    I started the web agency Luniq in 2025 and built Orbit from the software we used to keep our clients’ sites growing after launch. I write about search, AI answers and how to prove what website work earns.

Questions about measuring results

Google Search Console is Google’s free tool for site owners. It shows which searches a site appears for, how often people click, which pages are indexed, and any problems Google found, with 16 months of history.

Click-through rate is the share of people who saw a link and clicked it. Divide clicks by impressions and multiply by 100: 30 clicks from 1,000 impressions is a CTR of 3%. In search, a better title and description can raise it without any change in ranking.

Google Search Console shows the average position for every search a site appeared in, for free. A rank tracker checks chosen keywords every day, in a set location, so a drop has a date.

Add an analytics tool to the site, which counts visits, where they came from and what people did. Count people apart from bots and AI crawlers, or the numbers run high. Pair it with Google Search Console for the searches that brought people in.

What changed and why: the searches and pages that gained or lost visits, the leads search brought in, the work done that month and what it earned, and what comes next. A list of rankings without that story is the report clients stop reading.

An attribution model decides which visit gets the credit for a lead when someone came to the site more than once. First touch credits the visit that started it, last touch the one right before the lead, and linear shares the credit across every visit.

Organic traffic is the visitors who arrive from unpaid search results, as opposed to ads, social media or links on other sites. It is the traffic SEO work is meant to grow.

Conversion tracking counts the actions that matter on a site, such as a form sent, a call or a purchase, and ties each one to where the visitor came from. Without it, traffic numbers can’t say which pages or channels bring in business.

Put what you read to work

Connect your site and Orbit measures what these articles cover: searches, AI answers, site health and leads. Every new site starts with all of Orbit, free to try.

Ask Orbit

Answers from every page of goorbit.io

Ask about what Orbit does, what it costs, or how it fits the way you work. Each answer links to the page that covers it.

Try asking