Google Analytics (GA4) MCP server
betaGoogle publishes its own open source MCP server for Google Analytics that lets AI agents run GA4 reports through the Data API and Admin API. It runs locally or self-hosted and only reads by default.
What an agent can do
- → List accounts and properties
- → Run standard and funnel reports
- → Read realtime data and conversions
- → Read custom dimensions and key events
- → Show Google Ads links
By default the server cannot change anything in GA4. Started with the --allow-write flag it can create annotations, custom dimensions and key events, but not change or delete them.
About the Google Analytics (GA4) MCP server
The Google Analytics MCP server is an open source program that Google publishes in the googleanalytics organisation on GitHub and as the package analytics-mcp. It connects an AI assistant to Google Analytics through Google's own Admin API and Data API. Google does not host a shared address for it. You start it locally on a computer, or run it yourselves as a service over HTTP, for example on Google Cloud Run.
Teams use it to ask about their traffic in their own words: users per day, the most common events over the last 90 days, what is happening right now, where a funnel loses visitors and which key events produce conversions. The server also shows which accounts and properties you can reach, the property's settings, custom dimensions and metrics, links to Google Ads and the annotations on a property.
By default the server only reads, with the analytics.readonly scope, and the signed-in person needs the Viewer role on the property. The project README describes three write tools that create annotations, custom dimensions and key events. They only exist when the server is started with the --allow-write flag and the analytics.edit scope, and they need a higher role on the property. The server cannot delete anything, and Google states no rate limits on the documentation page.
Things to ask
- What are the most common events in our property over the last 90 days?
- Show the number of users per day this month compared with last month.
- How many people are on the site right now, and on which pages?
- Build a funnel from landing page to submitted form and show where most people drop off.
- Which custom dimensions and metrics exist in the property, and which Google Ads accounts are linked?
Tools the server exposes
- get_account_summaries
- get_property_details
- list_google_ads_links
- list_property_annotations
- list_key_events
- get_custom_dimensions_and_metrics
- run_report
- run_realtime_report
- run_funnel_report
- run_conversions_report
- create_property_annotation
- create_custom_dimension
- create_key_event
Part of these packages
Google Analytics (GA4) is part of these Walma packages.
Questions about Google Analytics (GA4) MCP
Is the Google Analytics MCP server free?+
The server is open source under the Apache 2.0 licence and is available on GitHub and as the package analytics-mcp. Google states no charge for the server itself. You need a Google Cloud project with the Google Analytics Admin API and the Google Analytics Data API enabled, and Python 3.10 or newer to run it.
What is the Google Analytics MCP server URL?+
There is no shared address at Google. The server is the package analytics-mcp, with the source at github.com/googleanalytics/google-analytics-mcp, and it is started locally with pipx run analytics-mcp. The project README also describes how to host it yourselves over HTTP, with Docker or on Google Cloud Run, which gives you your own address.
How does sign-in work?+
The server uses Application Default Credentials. Either you sign in with your own Google account through gcloud, or you use a service account with a key file or impersonation. The scope it needs is analytics.readonly, and the account needs the Viewer role on the property. If you run the server as a remote service, it has a built-in OAuth sign-in that is switched on with the --oauth flag.
Is it read-only?+
By default, yes. Google's documentation describes it as available for read requests only. The project README adds three write tools that create annotations, custom dimensions and key events, but only when the server is started with --allow-write and the analytics.edit scope. Without the flag the server cannot create, change or delete anything in Google Analytics.
Which AI assistants does it work with?+
Google's documentation shows the configuration for Antigravity, Claude Desktop, Claude Code and Cursor. The project README also names Gemini CLI, Gemini Code Assist in VS Code and Google's ADK framework for custom agents. In every case the client starts the server as a local command, unless you host it yourselves over HTTP.
Which reports can the assistant run?+
Four kinds of report: standard reports with the dimensions and metrics you choose, realtime reports, funnel reports and conversion reports. The assistant can also look up the property's custom dimensions and metrics, so that it knows which fields can be queried. The reports are fetched through the Google Analytics Data API.
Why do I get a 403 error when the server fetches data?+
Google gives three common causes. PERMISSION_DENIED means that one of the two APIs is not enabled or that the account lacks access to the property. ACCESS_NOT_CONFIGURED usually means a quota project is missing, which is solved with GOOGLE_CLOUD_PROJECT. Insufficient scopes require signing in again with the right scopes. Use absolute paths to the key file in desktop clients.
Missing a connection?
We build and review MCP servers for teams that need them, and run them behind the same policy and log as the rest of the gateway.