Google Analytics MCP Server
Lets Claude, Gemini or Cursor answer questions about your Google Analytics 4 data. Google's own server, run on your computer with your Google login.
This is Google's official way to let your AI assistant read your Google Analytics 4 data. You can ask it for users, top pages, best-selling products, funnels, realtime numbers and how your property is set up. It only reads by default, and it runs on your own computer, so you need Python, a Google Cloud project with two Analytics APIs turned on, and a Google login made with the gcloud tool. Google labels it experimental and there is no hosted version yet.
Good for
- Marketers and site owners who want traffic, sales and event answers without building reports
- Analysts who want quick GA4 checks and funnel reports from Claude Code, Gemini CLI or Cursor
- Developers building their own analytics agents on top of GA4
- Teams that need a read-only connection to Analytics by default
Works in
3 supported · 1 with issues · 8 should work
Tap an app to see how to set it up and any known problems.
Google's docs cover it: add the server to claude_desktop_config.json with your credentials path. developers.google.com
Google's docs cover it: add the server to .cursor/mcp.json and run it with uvx or pipx. developers.google.com
The README's main setup is for Gemini CLI: add the server to ~/.gemini/settings.json. GitHub
Google's docs give a claude mcp add command with your credentials path and Cloud project ID.
Known problems
- Open
On a Mac, every request can fail with a 'failed to resolve' error even though your internet works
Workaround: A pending docs fix suggests adding GRPC_DNS_RESOLVER=native to the server's env settings.
Since Jun 2026 · GitHub
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Client does not support this transport.
Client does not support this transport.
Install Google Analytics MCP
Claude Code
- 1
Copy this prompt.
Add the Google Analytics MCP server to Claude Code. Run this command: 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 Ask me for GOOGLE_APPLICATION_CREDENTIALS and only put the values in that config, nowhere else. Then check that it loaded and tell me if I need to sign in or restart.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Python 3.10+, pipx, gcloud CLI.
Read-only mode: It only reads by default. Keep it that way by not adding --allow-write to the arguments.
Before you add it: turn on the Google Analytics Admin API and Google Analytics Data API in a Google Cloud project, make sure your Google account (or service account) has at least Viewer on the GA4 property, then run gcloud auth application-default login with the analytics.readonly and cloud-platform scopes, as shown in Google's setup guide. If the app says it cannot find pipx or uvx, put the full path from which pipx in the command. On a Mac, if every request fails with a 'failed to resolve' error, a pending fix suggests adding GRPC_DNS_RESOLVER=native to the env settings.
From the vendor's docs. Source.
Tools
Runs a GA4 report on users, pages, events or sales for any date range
Pulls numbers from your GA4 property, such as users, sessions, page views, events or revenue, broken down by things like page, country or traffic source, for the dates you ask about.
Try: “Which pages had the most views last month, and where did that traffic come from?”
Network ·
run_reportShows what is happening on your site or app right now
Reads the realtime numbers for your property, such as how many people are active now and which pages or events they are on.
Try: “How many people are on my site right now, and which pages are they looking at?”
Network ·
run_realtime_reportShows where people drop off between the steps you name
Builds a funnel from steps you describe, such as product view, add to cart and purchase, and shows how many people make it through each step.
Try: “Show me the funnel from product page view to add to cart to purchase for the last 30 days.”
Network ·
run_funnel_reportReports how your conversions and key events are performing
Runs a conversions performance report for your property so you can see how your key events are doing.
Try: “How did my conversions do last week compared with the week before?”
Network ·
run_conversions_reportLists the Analytics accounts and properties you can access
Lists every Google Analytics account and property your login can see, so the assistant knows which one to report on.
Try: “Which Google Analytics properties do I have access to?”
Network ·
get_account_summariesShows how a property is set up, like time zone and currency
Reads the settings of one GA4 property, such as its name, time zone, currency and industry.
Try: “Give me details about my Google Analytics property with 'shop' in the name.”
Network ·
get_property_detailsLists the custom dimensions and metrics set up in a property
Lists the custom dimensions and custom metrics your property defines, so you can see what extra data you track and use it in reports.
Try: “What are the custom dimensions and custom metrics in my property?”
Network ·
get_custom_dimensions_and_metricsShows which Google Ads accounts are linked to a property
Lists the Google Ads accounts connected to a GA4 property.
Try: “Is my Google Analytics property linked to a Google Ads account?”
Network ·
list_google_ads_linksLists the notes added to a property's reports
Reads the annotations on a property, the dated notes that mark events like a launch or a tracking change.
Try: “What annotations are on my property this year?”
Network ·
list_property_annotationsAdds a dated note to a property's reports, only if you turn writes on
Creates an annotation on a property for one date or a date range, such as 'Spring sale started'. It only exists when the server is started with the write switch and your login has edit access.
Try: “Add an annotation called 'Pricing page redesign' on my property for today.”
Write ·
create_property_annotation
Read from the source code
Pros and cons
Good
- Built and maintained by the Google Analytics team
- Read-only unless you turn on the write switch
- Covers standard, realtime, funnel and conversions reports
- Reads property setup, custom dimensions, Google Ads links and annotations
- Each tool tells your AI app whether it only reads, so reads can be auto-approved
- Free and open source
Watch out
- Runs only on your computer, with no hosted URL to paste into ChatGPT or claude.ai
- Needs Python, a Google Cloud project, two enabled APIs and a gcloud login
- Google labels it experimental
- The gcloud login grants broad Google Cloud access for user accounts
- Mac users of Claude Code report requests failing to reach Google
Permissions
low risk · 3 things to watch
Low risk
It can read every GA4 property your Google login can see, and the login itself grants wider Google Cloud access than reading reports needs. Use a service account with Viewer access on only the properties you want it to see.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only modeHow to turn it on
Watch out for
The Google login reaches more than Analytics
The gcloud login asks for full Google Cloud access, and the server only narrows it for service accounts. Use a service account with Viewer access on just the properties you need. github.com
It can add notes to your reports if you allow it
With the write switch on, it can create annotations on a property. Leave it off unless you want that. github.com
Your Google credentials file sits on your disk
The server reads a credentials file from your computer. Keep it out of shared folders and code repos. developers.google.com
Security advisories
No published security advisories as of Nov 1, 2026.
Technical details
| Turning on read-only | Read-only is the default. The one write tool, create_property_annotation, is only registered when the server starts with --allow-write and the credentials include the analytics.edit scope. |
|---|---|
| Talks to | analyticsadmin.googleapis.com. analyticsdata.googleapis.com |
| Sign-in and keys | Application Default Credentials JSON file on your computer, referenced by GOOGLE_APPLICATION_CREDENTIALS |
| Scopes |
|
Alternatives
Use Google's server if you can run it on your computer and want the official, read-only default. Stape's hosted server is the pick when you want to sign in with Google in the browser and skip the Cloud setup.
| Server | Official | Runs | Sign-in | Can change things | GitHub stars |
|---|---|---|---|---|---|
| Google Analytics MCP ServerThis page | Official | Local | Google credentials | Opt-in | 3.6K |
| Stape Google Analytics | Community | Hosted | Google account | – | 6 |
| surendranb GA4 | Community | Local | – | – | 244 |
| Mindstone GA4 | Community | Local | – | – | – |
What people say
People like what it can answer once it works and dislike how hard it is to set up.
What people like
- People who get it running say asking GA4 questions in plain language works very well
Common complaints
- Setup is hard for marketers: Python, a Cloud project, two APIs and a gcloud login
- No hosted version with a simple Google sign-in, unlike PostHog, Amplitude or Mixpanel
- The gcloud login asks for broad Google Cloud access, which worries some users
- Some users saw replies take several minutes in Gemini CLI
In their words
“Google Analytics is used a lot by business / non coders and it is simply too hard for them to install it (for example try setting it up in Claude Desktop).”mderazonGitHub issueFeb 2026
“this is basically a no-go for many people as it is just too hard to install which is a shame as **once you get it working it's magical**”mderazonGitHub issueFeb 2026
“Agreed, a hosted MCP server would make life considerably easier for the average marketer and massively expand usage of ga4 in agentic workflows”stuartbrameldGitHub issueJul 2026
“For an AI agent connector, this feels like more access than necessary for simply reading analytics data, and a bit risky.”williamgurzoni
Questions
Is the Google Analytics MCP server free?
Yes. It is open source and free to run. Its requests count against your Google Cloud project's Analytics API quota.
Is there a hosted Google Analytics MCP URL?
Not from Google. Its server runs on your computer, and a change to add a hosted mode with Google sign-in is still waiting to be merged. Stape runs a separate hosted server if you need one now.
Can it change my Google Analytics settings?
Not by default. It only reads your data and settings. If you start it with the write switch and grant edit access, it can add annotations to a property, and nothing else.
Is it safe to connect Google Analytics to my AI assistant?
It is low risk because it only reads by default. The main concern is the Google login, which grants wider Google Cloud access than reading reports needs. A service account with Viewer access on chosen properties keeps it narrow.
Why do I get a 403 PERMISSION_DENIED error?
Usually the Analytics Admin API or Analytics Data API is not turned on in your Cloud project, your account is not at least a Viewer on the property, or your login is missing the read-only Analytics scope. User logins also need the Cloud project set as their quota project.
Why does Claude Desktop say it cannot start pipx?
Desktop apps often do not see the same programs your terminal does. Put the full path to pipx or uvx in the server's command, and use a full path, not ~, for your credentials file.
Can I use a service account instead of my own Google login?
Yes. Point the credentials setting at a service account key file, or log in as the service account with gcloud. Give that account Viewer access on the property in Google Analytics.
Does it work with ChatGPT?
Not directly. ChatGPT only connects to hosted servers, and Google's server runs on your computer.
How do I add it to Claude Code?
Use the Claude Code tab in the install box above. You need your credentials file path and Cloud project ID first.
Examples
Quick traffic check
How many users did I have yesterday?
SourceEcommerce best sellers
What were my top selling products yesterday?
SourceMarketing plan from your own numbers
I have a marketing budget of $5,000/month and need to generate more revenue. Help me create a data-driven marketing plan.
SourceEvent review
what are the most popular events in my Google Analytics property in the last 180 days?
SourceProperty setup audit
what are the custom dimensions and custom metrics in my property?
Source
Information
updated Nov 2, 2026
- Publisher
- Google (official)
- Package
analytics-mcp- Registry
- PyPI
- Transport
- stdio
- Auth
- token in env
- Version
- 0.8.0
- License
- Apache-2.0
- Last commit
- Oct 29, 2026
- Open issues
- 5
Other Google Analytics MCP servers
Sources
Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.
Show all 9Hide
- Try the Google Analytics MCP server · developers.google.com
- google-analytics-mcp README · github.com
- Question: Access level · github.com
- feat: add create_property_annotation tool, --allow-write flag, and MCP tool annotations · github.com
- feat: add multi-tenant Streamable HTTP transport and OAuth 2.1 support · github.com
- DNS Resolution Error with Claude Code · github.com
- Too hard to install · github.com
- All requests take too long · github.com
- How to configure the MCP Server for Google Analytics 4 · stape.io