Google Analytics 4 MCP Server — provides GA4 reporting tools via the Google Analytics Data API v1beta.
| Tool | Description |
|---|---|
get_ga4_report |
Run a custom GA4 report with any dimensions and metrics |
get_top_pages |
Top pages by pageviews |
get_traffic_sources |
Traffic source/medium breakdown |
get_user_metrics |
Aggregate user metrics (sessions, users, bounce rate) |
get_realtime_users |
Current realtime active users |
get_conversion_events |
Conversion events breakdown |
pip install -r requirements.txt- Go to Google Cloud Console
- Enable Google Analytics Data API
- Create a Service Account → download JSON key
- In GA4: Admin → Property Access Management → add the service account email with Viewer role
{
"mcpServers": {
"google-analytics-ga4": {
"command": "python",
"args": ["C:/path/to/mcp-server-ga4/server.py"],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "C:/path/to/service_account.json",
"GA4_PROPERTY_ID": "YOUR_NUMERIC_PROPERTY_ID"
}
}
}
}GA4 Console → Admin → Property → Property ID (numeric, e.g. 123456789)
Once configured, tools are available in Claude Code:
get_top_pages(start_date="7daysAgo", end_date="today", limit=10)
get_traffic_sources(start_date="30daysAgo")
get_realtime_users()
This server is part of a 13-server MCP suite. See techdeveloper-org for all servers.