google-analytics-mcp
Provides read-only access to Google Analytics 4 via the Data API and Admin API. Offers tools to list GA accounts and GA4 properties with their numeric ids, fetch property settings (time zone, currency, industry), run arbitrary GA4 reports (metrics × dimensions, date ranges, string filters, ordering, paging, totals), run realtime reports of active users over the last 30 minutes by page, country, device or event, get a combined overview (totals, top pages, top channels, top sources) for a date range, and list available dimensions and metrics including custom ones. Requests are authenticated per-request with a Google OAuth bearer token scoped to analytics.readonly.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@google-analytics-mcpshow me the overview for yesterday"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
google-analytics-mcp
A small, stateless MCP server for Google Analytics 4 (Data API + Admin API), served over Streamable HTTP.
It never stores credentials. Every request must carry Authorization: Bearer <Google access token>, and the server uses that token for that one request. An auth proxy such as Nango keeps the Google login, refreshes it, and adds the header. Because the token decides which account is used, one container serves any number of Google accounts.
MCP client ──► auth proxy (Nango: stores + refreshes the Google login)
│ Authorization: Bearer ya29…
▼
google-analytics-mcp ──► GA4 Data API / Admin APITools (all read-only)
Tool | What it does |
| GA accounts and GA4 properties the account can access, with numeric property ids |
| Property settings (time zone, currency, industry) |
| Any GA4 report: metrics × dimensions, date range, string filters, ordering, paging, totals |
| Users active in the last 30 minutes, by page, country, device, event |
| One call: totals, top pages, top channels, top sources for a date range |
| Available dimensions and metrics, including custom ones |
Dates accept YYYY-MM-DD, today, yesterday or NdaysAgo.
Related MCP server: Google Analytics MCP server on Cloudflare Workers
Google setup
Scope on the token:
https://www.googleapis.com/auth/analytics.readonly.In the Google Cloud project that owns the OAuth client, enable Google Analytics Data API and Google Analytics Admin API.
Configuration
Env var | Default | Purpose |
|
| Listen port |
|
| Listen address |
|
| MCP endpoint path |
|
| Timeout for each Google API call |
GET /health returns {"ok":true}. The server is stateless: only POST /mcp is served (GET and DELETE return 405), and a request without a bearer token gets 401.
Run
npm ci && npm run build
PORT=8000 node dist/index.jsor with Docker:
docker build -t google-analytics-mcp-http .
docker run --rm -p 8000:8000 google-analytics-mcp-httpKeep it on a private network behind the auth proxy.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Read-only SaaS business intelligence from GA4, Stripe, and Google Search Console.
Hosted MCP server for GA4, Google Ads and Search Console. Google OAuth, nothing to install.
Read and edit GA4, Search Console and Google Tag Manager from any MCP client. 29 tools.
Read-only access to your Nexly web analytics: traffic, pages, acquisition, events, and reports.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables interaction with Google Analytics 4 data through the Google Analytics Data API. Built using Google ADK UI and deployed on Google Cloud Platform with proper service account authentication for GA4 data access.-
- FlicenseNot gradedqualityCmaintenanceEnables MCP clients to read Google Analytics 4 data, deployed as a Cloudflare Worker with service account authentication.2-
- FlicenseNot gradedqualityCmaintenanceRead-only access to Google Analytics 4 reporting data, including traffic overview, top pages, traffic sources, and conversion events, supporting custom report queries via MCP.-
- AlicenseNot gradedqualityBmaintenanceA read-only MCP server exposing Google Analytics 4 and AdSense APIs (reports, metadata, admin reads) via Cloudflare Workers with OAuth authentication.MIT