D
dhawalshah/google-analytics-mcp
A Model Context Protocol (MCP) server for Google Analytics 4.
updated 2026-09-22
View on GitHub ↗Direct link · no redirect page
We have no copy-paste install command and no public remote endpoint, so we do not print a config. The step above is reference only, not a command we can vouch for. A made-up one is worse than none. How each client wires MCP up →
- Star count
- 0 ★ · dhawalshah/google-analytics-mcp · read from the GitHub search API · (checked 2026-11-19 20:00:48)
- Source
- collected from the punkpeye/awesome-mcp-servers list · type: MCP server
- Harvest history
- first seen 2026-11-18 · last seen 2026-11-20 · seen 3× · listed by 3 sources
- Score
- score 300 · 3 sources · mcp
FAQ (answers come from our records)
Who is it for?
We filed it under these tags: MCP servers. The tags come from the entry itself, not a taxonomy we imposed.
Who maintains it?
repository
dhawalshah/google-analytics-mcp;first catalogued 2026-11-18;last seen 2026-11-20。There is no official certification or quality rating here — we record sources and dates only.README excerpt (English, untranslated) · Read the full README on GitHub →
# Google Analytics MCP
Excerpted from the repository README (abridged)
A Model Context Protocol (MCP) server for Google Analytics 4. Connect Claude (or any MCP-compatible AI client) directly to your GA4 properties to query traffic, analyse user behaviour, inspect events, run funnel analysis, and more — all in natural language.
The server speaks the MCP authorization spec (2025-06-18), so it works as a remote connector anywhere Claude supports custom MCP servers — claude.ai (personal), Claude Desktop, and Claude Teams. Add one URL, click "Connect", sign in with Google, done. For a Teams plan, the org owner adds the URL once and each member individually authenticates on first use.
## What you can do
### Property Management
List all accessible GA4 accounts and their properties
### Reporting & Analytics
Page views, active users, events, traffic sources, and device metrics
Run fully custom reports with any GA4 metric and dimension combination
Funnel analysis — track user drop-off across multi-step flows (experimental)
### Real-time & Discovery
Active users in the last 30 minutes (Realtime API)
List all valid dimensions and metrics for a property — useful for building custom reports
## How auth works
There are two modes. Pick one.
### Mode A — Local STDIO (one user, no server)
Use this if you only want it on your own machine. setup_local_auth.py runs the Google OAuth flow once and stores your token in ~/.config/google-analytics-mcp/token.json. Claude Desktop launches server.py as a subprocess. No Firestore, no Cloud Run, no public URL.
### Mode B — Remote HTTP server (Claude Teams, claude.ai, multi-user)
The MCP server is also an OAuth 2.1 authorization server. When Claude connects:
1. Claude discovers our metadata at /.well-known/oauth-protected-resource and /.well-known/oauth-authorization-server.
2. Claude registers itself via Dynamic Client Registration (POST /oauth/register).
3. Claude redirects the user to /oauth/authorize. We delegate identification to Google OAuth.
4. After Google login, we issue our own opaque bearer token to Claude — Google credentials never leave the server.
5. On each /mcp request Claude sends our bearer; we map it server-side to the right user's stored Google credentials and call the GA4 APIs.
The ?user=email query string from older versions is gone — there are no per-user URLs to copy around.
## Prerequisites
Python 3.10+
A Google Analytics 4 property
A Google Cloud project
## Step 1 — Set up Google Cloud
### 1a. Create a project and enable the GA4 APIs
1. Go to the Google Cloud Console.
2. Create or select a project.
3. APIs & Services → Library, enable both:
Google Analytics Data API
Google Analytics Admin API
### 1b. Create OAuth 2.0 credentials
1. APIs & Services → Credentials → Create Credentials → OAuth 2.0 Client ID.
2. Application type: Web application.
3. Add Authorized redirect URIs:
http://localhost:8080/auth/callback (local dev / setup_local_auth.py)
https://YOUR-CLOUD-RUN-URL/auth/callback (remote deployment — add after deploy)
4. Click Create, then Download JSON → save as client_secret.json in the project root (gitignored). You can also copy the Client ID / Client Secret straight into env vars.
### 1c. OAuth consent screen
1. APIs & Services → OAuth consent screen.
The server speaks the MCP authorization spec (2025-06-18), so it works as a remote connector anywhere Claude supports custom MCP servers — claude.ai (personal), Claude Desktop, and Claude Teams. Add one URL, click "Connect", sign in with Google, done. For a Teams plan, the org owner adds the URL once and each member individually authenticates on first use.
## What you can do
### Property Management
List all accessible GA4 accounts and their properties
### Reporting & Analytics
Page views, active users, events, traffic sources, and device metrics
Run fully custom reports with any GA4 metric and dimension combination
Funnel analysis — track user drop-off across multi-step flows (experimental)
### Real-time & Discovery
Active users in the last 30 minutes (Realtime API)
List all valid dimensions and metrics for a property — useful for building custom reports
## How auth works
There are two modes. Pick one.
### Mode A — Local STDIO (one user, no server)
Use this if you only want it on your own machine. setup_local_auth.py runs the Google OAuth flow once and stores your token in ~/.config/google-analytics-mcp/token.json. Claude Desktop launches server.py as a subprocess. No Firestore, no Cloud Run, no public URL.
### Mode B — Remote HTTP server (Claude Teams, claude.ai, multi-user)
The MCP server is also an OAuth 2.1 authorization server. When Claude connects:
1. Claude discovers our metadata at /.well-known/oauth-protected-resource and /.well-known/oauth-authorization-server.
2. Claude registers itself via Dynamic Client Registration (POST /oauth/register).
3. Claude redirects the user to /oauth/authorize. We delegate identification to Google OAuth.
4. After Google login, we issue our own opaque bearer token to Claude — Google credentials never leave the server.
5. On each /mcp request Claude sends our bearer; we map it server-side to the right user's stored Google credentials and call the GA4 APIs.
The ?user=email query string from older versions is gone — there are no per-user URLs to copy around.
## Prerequisites
Python 3.10+
A Google Analytics 4 property
A Google Cloud project
## Step 1 — Set up Google Cloud
### 1a. Create a project and enable the GA4 APIs
1. Go to the Google Cloud Console.
2. Create or select a project.
3. APIs & Services → Library, enable both:
Google Analytics Data API
Google Analytics Admin API
### 1b. Create OAuth 2.0 credentials
1. APIs & Services → Credentials → Create Credentials → OAuth 2.0 Client ID.
2. Application type: Web application.
3. Add Authorized redirect URIs:
http://localhost:8080/auth/callback (local dev / setup_local_auth.py)
https://YOUR-CLOUD-RUN-URL/auth/callback (remote deployment — add after deploy)
4. Click Create, then Download JSON → save as client_secret.json in the project root (gitignored). You can also copy the Client ID / Client Secret straight into env vars.
### 1c. OAuth consent screen
1. APIs & Services → OAuth consent screen.
Listed badge (optional)
Copy this line into the README if you want the listing mark. Optional, and it does not affect being listed.
[](https://anclum.com/en/s/dhawalshah-google-analytics-mcp/)
- Source
- awesome · https://github.com/dhawalshah/google-analytics-mcp
- Browse by field
- MCP servers
- Listed by
- 3 independent sources
- added
- today
More MCP servers
Filed under
Every tag opens the full list for that filter. Counts are the live catalogue figures.