Sign inGet started
Compare

Google Analytics MCP server

View as MarkdownOpen in ChatGPTOpen in Claude
Connect your agent
Add to CursorAdd to VS Code

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/mcp

We 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?

nextanalyticaGoogle Analytics MCP server
SetupAdd one address to your agent and sign inPython, a Google Cloud project, two APIs and a credentials file on each computer
Who runs itnextanalyticaYou: on your computer, or on a server you host and keep running
Your teamEach person signs in as themselves, with owner, admin and member rolesEach person repeats the setup, or you host a shared server
What your agent readsYour site's visits, AI assistants, AI crawlers, Search Console, Bing Webmaster Tools, ChatGPT Ads, Odoo and GA4GA4 reports
AI assistant trafficIts own channel, joined to the assistant's fetch, conversions and ordersGA4's AI Assistant channel: visits, with no link to what the assistant read
AI crawlersGPTBot, ClaudeBot, PerplexityBot and more, checked against the addresses their owners publishNot visible: bots don't run the Google tag
Visitors who haven't answered the cookie bannerCounted, without cookiesNot counted as visits until they agree; estimated in some reports
Checks on a scheduleSkills your agent runs, and daily rulesNone: it answers only when asked
What your agent knows about your businessYour team's instructions and memory, read before every answerNothing between conversations
Where your site's data is keptThe EU (Nuremberg)Google's servers
Depth in GA4Daily sessions, key events, pages, countries and devicesAny 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:

  1. Install Python 3.10 or later and pipx or uv.
  2. In a Google Cloud project, enable the Google Analytics Admin API and the Google Analytics Data API.
  3. In Google Analytics, give your Google account (or a service account) at least the Viewer role on the property.
  4. Create Application Default Credentials with gcloud auth application-default login and the analytics.readonly scope.
  5. 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-mcp

Each 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.

Next steps

Related
  • Best analytics MCP servers: Which analytics tools your agent can read over MCP: nextanalytica, Google Analytics, PostHog, Plausible, Umami and more, compared on setup and access.
  • PostHog MCP server: PostHog's MCP server reads and writes across its whole product suite; nextanalytica is web analytics built for your agent. Setup, access and checks compared.
  • Google Search Console MCP: Read Search Console in Claude or Cursor: the open-source GSC MCP servers compared with a hosted MCP that reads Search Console next to your visits.
  • Compare: How nextanalytica compares with PostHog, Plausible and Google Analytics: who reads the numbers, MCP, checks on a schedule and cookies.
  • nextanalytica vs Google Analytics: nextanalytica vs Google Analytics 4: where each fits, how their MCP servers differ, and how to read GA4 next to our own data with your agent.
  • nextanalytica vs PostHog: nextanalytica vs PostHog: a web analytics your own agent reads over MCP, or a product platform with its own AI. Where each fits, and how they differ.
Still have questions?
Was this page useful?