What is the Google Analytics MCP server?
The Google Analytics MCP server is an open source server from the googleanalytics GitHub organization. It lets an AI agent list accounts and properties, run reports, funnels and realtime reports, and read key events. You run it with pipx run analytics-mcp, using Google Application Default Credentials.
The repo describes it as source code for running a local or remote multi-tenant MCP server that talks to Google Analytics APIs. It uses the Analytics Admin API and the Analytics Data API to give an AI agent a set of read tools, and a few opt-in write tools.
By default it runs locally over stdio as the analytics-mcp package. It can also run as a shared HTTP service where each end user signs in with their own Google account.
What it changes in your workflow
- Ask which properties you have, then request a traffic report in plain language instead of building it in the Google Analytics interface.
- Run funnel and conversions reports, including ad costs, ROAS and attribution models, through the Data API.
- Check realtime activity with a realtime report.
- Write tools, such as creating a property annotation or a key event, stay off until you pass the --allow-write flag.
Setup at a glance
| Google Analytics MCP | |
|---|---|
| Where it runs | Locally through pipx run analytics-mcp, or as an HTTP service |
| Auth | Google Application Default Credentials with the analytics.readonly scope |
| Write access | Off by default; needs --allow-write and the analytics.edit scope |
| Google Cloud | Enable the Analytics Admin API and Analytics Data API in your project |
| Hosted option | Docker image for Cloud Run, plus an optional built-in OAuth 2.1 server |
Who it is for
Best for
- Marketers and developers who want Google Analytics numbers inside the agent they already use.
- Teams that need per-user Google sign-in on a shared service, using the HTTP and OAuth modes.
- Analysts who want funnels and conversions queried through prompts rather than the Google Analytics UI.
Not for
- Sites that use another analytics tool. It reads Google Analytics only.
- Quick no-config setups. You must enable APIs and configure credentials in Google Cloud first.
- Search queries and rankings. For on-page checks see the web SEO skill.
Use it with UiChemy
Read Google Analytics results for pages you built with UiChemy and let the agent suggest what to change. Composer, Figma to WordPress and AI to WordPress produce the pages; this server reports how they perform. Click Get Started on uichemy.com. For tuning, see the web quality audit skill.
Connect Google Analytics MCP Server: Reports for AI Agents to your AI client
pipx run analytics-mcpInstall pipx
The README starts with Configure Python and tells you to install pipx.
Enable the APIs
In your Google Cloud project, enable the Google Analytics Admin API and the Google Analytics Data API.
Set up credentials
Create Application Default Credentials for a user with access to your accounts or properties, with the analytics.readonly scope. Use a service account impersonation or an OAuth client as the README shows.
Add the server
Put the config above in your client file, or for Claude Code run the claude mcp add analytics-mcp command from the README with the two environment variables.
Optional: allow writes
Append --allow-write to args and add the analytics.edit scope if you want the annotation, custom dimension and key event tools.
Client configuration
{
"mcpServers": {
"analytics-mcp": {
"command": "pipx",
"args": ["run", "analytics-mcp"],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "PATH_TO_CREDENTIALS_JSON",
"GOOGLE_CLOUD_PROJECT": "YOUR_PROJECT_ID"
}
}
}
}Endpoints and ports
pipx run analytics-mcpStarts the server over stdio.pipx run analytics-mcp --transport http --stateless-http --port 8080For a shared multi-tenant service.https://www.googleapis.com/auth/analytics.readonlyRequired scope for the read tools.https://www.googleapis.com/auth/analytics.editNeeded only with --allow-write.What you can do with it
- Read-first designAccount, report, funnel, conversions and realtime tools work with the read-only scope.
- Opt-in writesAnnotation, custom dimension and key event tools require an explicit --allow-write flag.
- Admin and Data APIsThe server uses both Google Analytics APIs, covering configuration and reporting.
- Multi-tenant HTTPRun with --transport http --stateless-http to serve many users from one service.
- End-user OAuthThe --oauth flag turns on a built-in MCP OAuth 2.1 server where each user signs in with their own Google account.
- Cloud Run readyA root Dockerfile runs the server in stateless HTTP mode, with options set by environment variables.
- Client setupThe README gives setup for Gemini CLI and Gemini Code Assist, and a one-line command for a second client.
Tools it exposes
get_account_summaries
Retrieves information about your Google Analytics accounts and properties.
get_property_details
Returns details about a property.
list_google_ads_links
Returns links to Google Ads accounts for a property.
list_property_annotations
Returns annotations for a property.
list_key_events
Returns the key events defined on a property.
run_report
Runs a Google Analytics report using the Data API.
run_funnel_report
Runs a funnel report.
run_conversions_report
Runs a conversions report with ad costs, conversions, ROAS and attribution models.
get_custom_dimensions_and_metrics
Retrieves custom dimensions and metrics for a property.
run_realtime_report
Runs a realtime report.
create_property_annotation
Creates an annotation. Needs --allow-write and the analytics.edit scope.
create_custom_dimension
Creates a custom dimension. Needs --allow-write, the edit scope and the Editor role.
create_key_event
Marks an event as a key event. Needs --allow-write, the edit scope and the Marketer or Editor role.
Frequently asked questions
What is the Google Analytics MCP server?
It is an open source MCP server from the googleanalytics GitHub organization. It connects an AI agent to Google Analytics through the Admin and Data APIs, with tools to list accounts, run reports and funnels, read realtime data and view key events.
How do I install the Google Analytics MCP server?
Install pipx, enable the Analytics Admin and Data APIs in Google Cloud, set Application Default Credentials, then add a server using command pipx and args run analytics-mcp. Set GOOGLE_APPLICATION_CREDENTIALS and GOOGLE_CLOUD_PROJECT in env.
Which Google Analytics data can it read?
It reads through the Google Analytics Admin API and Data API. Tools cover account summaries, property details, Google Ads links, annotations, key events (formerly conversions), custom dimensions and metrics, and core, funnel, conversions and realtime reports.
Can the Google Analytics MCP server change my data?
Only if you allow it. Write tools such as create_property_annotation, create_custom_dimension and create_key_event need the --allow-write flag and the analytics.edit scope, and some need the Editor or Marketer role on the property.
Which AI clients does it support?
The README gives setup for Gemini CLI and Gemini Code Assist through ~/.gemini/settings.json, and a claude mcp add command for Claude Code. Any MCP client that can start a stdio command should accept the same pipx entry, which the README does not promise.
Can I run it for several users?
Yes. Start it with --transport http and --stateless-http for a shared service. Users can sign in with their own Google accounts through agent framework OAuth or the built-in --oauth server. That provider keeps tokens in memory, so restarts require sign-in again.
What does the Google Analytics MCP server cost?
The repo is Apache-2.0 open source, so the server itself has no stated fee. Google Cloud and Analytics usage and any hosting you add follow their own pricing, which the README does not list.
How do I use it for site performance questions?
Ask for a report on landing pages or traffic sources, then pair it with an audit. See the web quality audit skill for lab checks and the web performance skill for fixes.


