Google Analytics MCP server
What the Google Analytics MCP server (GA4 MCP) does, how to set it up in Claude Code or Cursor, what it can't read, and when a hosted MCP fits better.
Updated
The Google Analytics MCP server, often called the GA4 MCP server, is Google's open-source server that lets your agent read Google Analytics 4 reports. Before your agent can ask anything, you set up a Google Cloud project, Python and credentials on each computer, or host the server yourself. And it only knows what the Google tag collected.
nextanalytica is web analytics built for your agent. You add one address and sign in, and your agent reads your site's visits, AI assistant traffic, AI crawlers, Search Console and GA4 in one place, while skills check the numbers on a schedule.
This command adds nextanalytica to Claude Code:
claude mcp add --transport http nextanalytica https://mcp.nextanalytica.app/mcpWe checked Google's side on its own pages on November 29, 2026: the developer guide and the GitHub repository (version 1.1.0).
How do they compare?
| nextanalytica | Google Analytics MCP server | |
|---|---|---|
| Setup | Add one address to your agent and sign in | Python, a Google Cloud project, two APIs and a credentials file on each computer |
| Who runs it | nextanalytica | You: on your computer, or on a server you host and keep running |
| Your team | Each person signs in as themselves, with owner, admin and member roles | Each person repeats the setup, or you host a shared server |
| What your agent reads | Your site's visits, AI assistants, AI crawlers, Search Console, Bing Webmaster Tools, ChatGPT Ads, Odoo and GA4 | GA4 reports |
| AI assistant traffic | Its own channel, joined to the assistant's fetch, conversions and orders | GA4's AI Assistant channel: visits, with no link to what the assistant read |
| AI crawlers | GPTBot, ClaudeBot, PerplexityBot and more, checked against the addresses their owners publish | Not visible: bots don't run the Google tag |
| Visitors who haven't answered the cookie banner | Counted, without cookies | Not counted as visits until they agree; estimated in some reports |
| Checks on a schedule | Skills your agent runs, and daily rules | None: it answers only when asked |
| What your agent knows about your business | Your team's instructions and memory, read before every answer | Nothing between conversations |
| Where your site's data is kept | The EU (Nuremberg) | Google's servers |
| Depth in GA4 | Daily sessions, key events, pages, countries and devices | Any Data API report, funnels, realtime, custom dimensions |
Why do teams pick nextanalytica?
Because it answers the questions GA4 has no data for, and it's ready for the whole team in a minute.
It sees what Google's server can't
nextanalytica counts your site itself, so your agent can answer:
- Did ChatGPT send that visit, and did it buy? Visits from ChatGPT, Claude, Perplexity and other assistants are their own channel. When the assistant fetched your page in the 30 minutes before the visit, nextanalytica joins the two, with the visit's conversions and orders. See Traffic from ChatGPT.
- Which AI crawlers read my pages? A small sender on Cloudflare, Next.js or WordPress passes each AI crawler's hit, and nextanalytica checks it against the addresses the bot's owner publishes. See AI crawlers.
- How many people really came? The tag counts without cookies until a visitor agrees, so a visitor who never answers your banner is still a visit. See Cookieless counting and consent.
- How does search compare with my own numbers? Search Console, Bing Webmaster Tools and GA4 sit next to your visits, so your agent reads them together.
It watches the numbers for you
Google's server answers when you ask. nextanalytica's skills run on a schedule, check what changed and tell your team what to fix, so a drop doesn't wait for someone to notice it. See Skills.
It knows your business
Your team writes down what matters once: the goal, decisions, what worked. Your agent reads that project knowledge before every answer and every run, so nobody repeats it in every chat.
It's ready for your team
Every person connects their own agent as themselves, with nothing to install and no credentials to pass around. Owners decide who reads and who sets things up, and an agent can be limited to reading. See Team access.
How do you set up Google's server?
Google's server reads GA4 through the Admin API and the Data API: reports, funnels, conversions with ad costs and ROAS, realtime data, key events, annotations and custom dimensions. Three tools that change your property (annotations, custom dimensions and key events) work only when you start it with --allow-write. To set it up:
- Install Python 3.10 or later and
pipxoruv. - In a Google Cloud project, enable the Google Analytics Admin API and the Google Analytics Data API.
- In Google Analytics, give your Google account (or a service account) at least the Viewer role on the property.
- Create Application Default Credentials with
gcloud auth application-default loginand theanalytics.readonlyscope. - Add the server to your agent with the path to those credentials and your project ID.
This command adds it to Claude Code, as Google's guide shows it:
claude mcp add analytics-mcp \
--scope user \
-e GOOGLE_APPLICATION_CREDENTIALS="PATH_TO_CREDENTIALS_JSON" \
-e GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID" \
-- pipx run analytics-mcpEach person on your team repeats these steps on their own computer. Since version 1.0 you can instead host the server as a shared HTTP service with OAuth 2.1, for example on Google Cloud Run, and keep it running yourself: Google doesn't host an endpoint for you.
How does nextanalytica read GA4?
GA4 is one of nextanalytica's sources. When you connect a property, nextanalytica reads, by day:
- Sessions and key events by source, medium and campaign
- Page views and entries by page path
- Sessions and key events by country and device
It imports the property's history back to the day it was created (never before August 2020), syncs every hour and asks Google for read-only access. So your agent sees years of GA4 history on day one, next to the visits nextanalytica counts from then on. See Google Analytics 4.
When is Google's server the better choice?
When you need GA4 in full: custom dimensions, realtime reports, funnels, or conversion reports with ad costs and ROAS. nextanalytica reads GA4 as daily totals and never writes to it. Google's server also fits when you want your agent to create annotations or key events.
Can you use both?
Yes. An agent can have several MCP servers at once. Use nextanalytica for your site's visits, AI traffic, your other sources and checks on a schedule, and add Google's server when you need a deep GA4 report.