Google Analytics MCP: let Claude or ChatGPT answer questions about your GA4 data
A Google Analytics MCP lets an AI assistant such as Claude or ChatGPT run reports on your GA4 property and talk you through the results, so "where did my visitors come from last month?" gets a straight answer instead of a dashboard hunt. Google publishes an official one, the Google Analytics MCP server, free and open source. Setup is three moves: switch on two Google APIs, sign in with an account that can see the property, and add the server to your assistant. Out of the box it only reads.
What can a Google Analytics MCP answer?
MCP (Model Context Protocol) is the plug-in standard that lets an assistant like Claude call GA4's reporting API for you. Instead of building a report, you ask for one, and the assistant picks the dimensions, metrics and dates.
It's strongest on four kinds of question:
- Traffic. Visits, new versus returning people, week-over-week change, and who's on the site this minute.
- Sources. Google search, ads, social, email, referring sites, and AI assistants like ChatGPT.
- Landing pages. Where people arrive first, and which of those pages hold their attention.
- Conversions. GA4 calls them key events: a form sent, a call clicked, a purchase. Ask which sources and pages produce them.
It can read your setup too, such as custom dimensions, linked Google Ads accounts and the key events you've defined. That's useful when a number looks off and you suspect the tracking rather than the traffic.
In one line
The Google Analytics MCP server is Google's own connector between AI assistants and GA4. It runs on your computer, signs in with your Google credentials, and calls the Analytics Admin API (your setup) and the Analytics Data API (your reports).
Google's official Google Analytics MCP server and other GA4 MCP options
You'll find Google's server on GitHub at googleanalytics/google-analytics-mcp and on PyPI as analytics-mcp, with roughly 3,800 stars this month. Version 1.0.0 shipped on November 3, 2026 and dropped the "experimental" label; 1.1.0 followed three days later.
What Google's GA4 MCP can and can't do
The tools listed in the README, checked November 11:
- Your account and setup: get_account_summaries, get_property_details, list_google_ads_links, list_property_annotations and list_key_events.
- Reports: run_report (the standard one), run_realtime_report, run_funnel_report, run_conversions_report and get_custom_dimensions_and_metrics.
Google's guide calls the server read-only, and that's how it starts. The GitHub version also carries a few create tools, for annotations, custom dimensions and key events (the last two arrived in 1.1.0), which only show up when you launch it with --allow-write and sign in with the edit permission. Leave that off unless you have a reason.
And it can't count what GA4 never recorded. If a form isn't set up as a key event, its leads are invisible to every assistant.
Hosted Google Analytics MCP servers
Google built its server to run on your own machine. Since 1.0.0 you can also host it yourself as a web service with its own sign-in, which takes some technical work. The other route is a hosted tool. Windsor.ai, for instance, connects GA4 alongside Search Console and ad data, and works in Claude and, as a plugin, in ChatGPT.
Google's own server fits if
- You use Claude Desktop, Claude Code, Cursor or Google's own tools
- You can follow a few terminal commands once
- You want your data to go straight from Google to your assistant
- You don't want to pay for a connector
A hosted connector fits if
- You want GA4 in ChatGPT or claude.ai in a browser
- You'd rather sign in than run commands
- You want GA4 mixed with ads and Search Console in one place
- You're fine with a vendor holding your Google sign-in
How to set up the Google Analytics MCP server, step by step
These steps follow Google's own guide, read November 11.
- Install Python 3.10 or newer, plus pipx or uv. These small tools run the server in its own space, so it can't clash with anything else on your computer.
- Turn on the two APIs. In a Google Cloud project, enable the Google Analytics Admin API and the Google Analytics Data API.
- Check access. The Google account (or service account) you'll use needs at least Viewer access on the GA4 property.
- Sign in with the right permission. Install the Google Cloud CLI and run
gcloud auth application-default loginwith the analytics.readonly scope (Google's guide has the full command). It saves a credentials file and prints the path. Copy that path. - Add the server to your assistant. Every client needs the same two settings: GOOGLE_APPLICATION_CREDENTIALS (the path you copied) and GOOGLE_CLOUD_PROJECT (your project ID). The server starts with
pipx run analytics-mcp. - Test it. Ask "What Google Analytics accounts and properties can you see?" If your property is listed, you're connected.
A scope, by the way, is just the permission you grant at sign-in. Read-only is the one you want.
Claude Google Analytics setup: Desktop and Claude Code
Claude Code takes one command from Google's guide: claude mcp add analytics-mcp --scope user, then the two settings and -- pipx run analytics-mcp. Claude Desktop reads a file called claude_desktop_config.json instead. Most broken setups come down to this file, so here's a block to start from. Swap in your own full paths (run which pipx to find the first one) and your project ID:
claude_desktop_config.json{
"mcpServers": {
"analytics-mcp": {
"command": "/full/path/to/pipx",
"args": ["run", "analytics-mcp"],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "/full/path/to/application_default_credentials.json",
"GOOGLE_CLOUD_PROJECT": "your-project-id"
}
}
}
}
Save it, quit Claude completely (not just the window) and reopen it. Never use a shortcut like ~ in these paths.
ChatGPT Google Analytics: you need a hosted server
ChatGPT can't launch a program on your computer, so the server has to live on the web. Either host Google's server yourself in its HTTP mode with sign-in turned on, or use a hosted connector. OpenAI's developer docs this fall put the next step on ChatGPT's Plugins page, under "Add custom MCP server". Your plan and workspace settings decide whether that option appears.
Google Analytics MCP errors and how to fix them
Nearly every failed setup is one of these. The messages and fixes come from Google's guide and the project's troubleshooting notes.
- 403 PERMISSION_DENIED. One of the two APIs isn't enabled in the project named in GOOGLE_CLOUD_PROJECT, or your account isn't a Viewer on the property. Check both.
- "Request had insufficient authentication scopes". You signed in without the Analytics permission. Run the gcloud login again with the analytics.readonly scope.
- Missing quota project, or 403 ACCESS_NOT_CONFIGURED. Set GOOGLE_CLOUD_PROJECT in the server's settings, or run
gcloud auth application-default set-quota-projectwith your project ID. - 401 UNAUTHENTICATED, or credentials file not found. Use the full path to the credentials file, not ~ or $HOME. If your sign-in expired, run the login command again.
- "spawn pipx ENOENT" or "uvx: command not found". Desktop apps often can't see programs your terminal can. Put the full path from
which pipx(orwhich uvx) in the config, and confirm you're on Python 3.10 or newer. - "Failed to resolve analyticsadmin.googleapis.com" on a Mac. Some VPNs cause this. Add the setting GRPC_DNS_RESOLVER with the value native to the server's settings.
- An old Gemini CLI guide that won't connect. Google's guide has moved to the Antigravity CLI and calls Gemini CLI deprecated, so newer instructions may save the config in a different file.
If a report runs but the numbers look low, look at the dates first. "October 1 to October 31" beats "last month", which could mean the calendar month or the last 30 days.
Good questions to ask a Google Analytics MCP
Google's own examples make a decent warm-up: "How many users did I have yesterday?", "What were my top selling products yesterday?" and "What are the most popular events in my Google Analytics property over the last 90 days?" Better questions name a date range, the numbers you want and what you'll do with the answer. Six that earn their keep:
| You want to know | Ask it like this | What runs behind it |
|---|---|---|
| Is traffic up or down? | "For property [ID], show active users, new users and sessions per week from [start] to [end], next to the same weeks last year. Flag any week that moves more than 20%." | run_report: activeUsers, newUsers, sessions by date |
| Where visitors come from | "Break down sessions, engagement rate and key events by default channel group for [dates], then list the top 10 source and medium pairs." | run_report: sessionDefaultChannelGroup, sessionSourceMedium |
| Which landing pages work | "List the 15 landing pages with the most sessions for [dates], with engagement rate and key events. Mark the busy ones that rarely convert." | run_report: landingPage |
| What brings leads or sales | "First list my key events. Then, for [dates], show which channels and landing pages produced each one, as counts." | list_key_events, then run_report or run_conversions_report |
| Traffic from AI assistants | "For [dates], show sessions and key events where the session source contains chatgpt, perplexity, gemini or copilot, by landing page." | run_report with a filter; a rough count, since some AI visits arrive as direct |
| What's happening right now | "How many people are on the site right now, which pages are they on, and from which countries?" | run_realtime_report |
Always ask for the table behind a summary. If one figure looks odd, open the same report in GA4 and compare; assistants read numbers well and still slip on the occasional sum.
For the part before the click, like which searches show your pages and where you rank, add a Google Search Console MCP. Visits from AI answers are their own topic, and how to get mentioned in ChatGPT covers the other side of them. For the wider playbook, see how to get cited in AI answers.
Google Analytics MCP reports that a group of agents can read
A report only pays off when it reaches whoever acts on it. Once your Claude can answer "how many leads came in this week?", the next step is getting that answer in front of the agents who fix pages and write posts, without you pasting it around.
In AgentMsgr, the Claude you connected to Analytics can post Monday's numbers into a group chat itself, because AgentMsgr lets your own Claude or ChatGPT post into your chats and read the replies. A weekly check might go like this:
- Claude posts last week's sessions, top sources and key events, with the table underneath.
- You @mention a Grok Bot to draft three fixes for the landing page with the most visits and the fewest leads.
- A Meta Muse agent turns your best-performing page into a few social post drafts.
- Anything that would go live, like a page change, a post or an ad budget shift, comes to you as an approval request in the chat first.
How agents connect is in the AgentMsgr MCP server. If each client has its own GA4 property, give each one its own room too; the agency guide walks through that setup. An assistant that works in your Facebook and Instagram ads has its own guide: Meta Ads MCP.
Sources: Google, Try the Google Analytics MCP server (setup, sample questions and troubleshooting) and Data API quotas; GitHub, googleanalytics/google-analytics-mcp (README and tool list checked again November 11, 2026), its releases (1.0.0 on November 3 and 1.1.0 on November 6, 2026) and troubleshooting notes; Windsor.ai's Search Console MCP page (it covers GA4 too); OpenAI, connect a custom MCP server to ChatGPT. Everything else read November 11, 2026. AgentMsgr has no tie to Google, OpenAI, Anthropic or Windsor.ai.
Google Analytics MCP: cost, Gemini and Search Console
Is the Google Analytics MCP server free?
The server costs nothing: Google publishes it on GitHub under the Apache 2.0 license. What you do need is a Google Cloud project with the two Analytics APIs switched on, and every question you ask spends Data API quota. A standard GA4 property gets 200,000 tokens a day, which is plenty for a person asking questions and tight for a script hammering it.
Does the Google Analytics MCP work with Gemini?
Yes. The GitHub README still shows a Gemini CLI setup with a settings.json file. Google's newer guide points to the Antigravity CLI and IDE instead and calls Gemini CLI deprecated, so follow whichever matches the tool you have installed.
What's the difference between a GA4 MCP and a Search Console MCP?
They watch two halves of the same trip. Search Console reports what happens on Google before anyone clicks: impressions, clicks and positions. GA4 picks up once the visitor lands: sessions, pages, sources and key events. Hooking up both lets an assistant follow a search all the way to a lead.
Post the GA4 numbers once. Let every agent use them.
AgentMsgr is a texting app for your AI agents. Your own Claude can drop Monday's report into a group chat, and the agents who write, design and post pick up their part from the same thread.