Skip to content
Skillpedia
● Free and open sourceπŸ’» LocalπŸ”‘ Needs an API keyData and databases

Google Analytics 4 MCP Server

Lets your AI agent pull Google Analytics 4 reports: traffic, user behavior and real-time data.

244 stars on GitHubby surendranbLicense MITUpdated 22 days ago

How to install

This MCP is local: it runs on your computer.

It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Code…). Choose your app:

Paste in the terminal:

claude mcp add google-analytics -e GOOGLE_APPLICATION_CREDENTIALS="<your value>" -e GA4_PROPERTY_ID="<your value>" -- uvx google-analytics-mcp

What to fill in

NameWhat it isRequired
GOOGLE_APPLICATION_CREDENTIALSAbsolute path to your Google Cloud service account JSON key with GA4 property access.Yes
GA4_PROPERTY_IDNumeric GA4 Property ID to query, for example 123456789.Yes

Ready! Now test it

Restart the app and paste one of these requests in the chat:

Why did traffic drop last Tuesday?
Show sessions by channel for the last 30 days.

What it is

This server gives AI agents analysis-ready access to Google Analytics 4. It can discover which dimensions and metrics a property has, run multi-dimensional reports with server-side totals, and show real-time users. It also includes built-in analysis playbooks, such as for traffic drops or ecommerce.

What it can do

  • get_ga4_data: run reports with dimensions, metrics and date ranges
  • list_accounts: list your GA accounts
  • list_properties: list GA4 properties
  • get_property_metadata: see dimension and metric schemas
  • run_realtime_report: active users and events from the last 30 minutes
  • search_skills, skill_read and skills_list: analysis playbooks

When to use

  • β€ΊWhen you want to know why website traffic suddenly dropped
  • β€ΊWhen you want a channel or ecommerce report without opening GA4
  • β€ΊWhen you want to see how much traffic comes from ChatGPT, Claude or Perplexity

What you need

A GA4 property ID and Google credentials (a service account JSON file set in GOOGLE_APPLICATION_CREDENTIALS). Run with uvx google-analytics-mcp or npx.

Skills that pair well

⭐ Skillpedia MCP Β· freeYour agent finds the right skill on its ownInstall our MCP and your agent searches 15,000+ skills whenever it needs one.Install for free β†’

Frequently asked questions

Is it free and open source?

Yes, it is MIT licensed. You still need a Google Analytics 4 property.

What credentials does it need?

A GA4_PROPERTY_ID and Google credentials such as a service account file.

Does it collect telemetry?

It sends anonymous diagnostic data (commands, latency, error codes). Opt out with DO_NOT_TRACK=1 or MCP_TELEMETRY_OPT_OUT=1.

Does it send my queries?

The readme says no queries, credentials or personal data are collected.

Which clients work?

Claude Desktop, Claude Code, Cursor, VS Code, Zed, Windsurf and others.

Where do the playbooks come from?

They load dynamically from GitHub.

If it does not work

  • β€ΊSet GA4_PROPERTY_ID and GOOGLE_APPLICATION_CREDENTIALS in the server env.
  • β€ΊMake sure the service account has access to your GA4 property.
  • β€ΊCheck that uvx or Node.js is installed, then restart your AI app.

5 new skills a week. 1 minute to read.