Google Analytics 4 MCP: reports, realtime data, custom dimensions, data streams.
{
"mcpServers": {
"io-github-mharnett-ga4": {
"command": "<see-readme>",
"args": []
}
}
}No install config available. Check the server's README for setup instructions.
Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
Google Analytics 4 MCP: reports, realtime data, custom dimensions, data streams.
Is it safe?
No package registry to scan.
No authentication — any process on your machine can connect.
License not specified.
Is it maintained?
Commit history unknown.
Will it work with my client?
Transport: stdio. Works with Claude Desktop, Cursor, Claude Code, and most MCP clients.
No automated test available for this server. Check the GitHub README for setup instructions.
No known vulnerabilities.
This server is missing a description. Tools and install config are also missing.If you've used it, help the community.
Add informationHave you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
MCP Server for GCP environment for interacting with various Observability APIs.
AI cost tracking: 11 tools for spend, budgets, and Claude Code + Cursor + Cline costs
Real-time GitHub Actions observability: DORA Metrics, Cost Analysis, CI/CD Health dashboards.
MCP server for Yandex.Direct API — campaigns, ads, statistics, keywords. Bearer token auth.
MCP Security Weekly
Get CVE alerts and security updates for io.github.mharnett/ga4 and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
MCP server for Google Analytics 4 -- run reports, realtime data, custom dimensions, and property management via Claude.
npm install mcp-ga4
Or clone the repository:
git clone https://github.com/drak-marketing/mcp-ga4.git
cd mcp-ga4
npm install
npm run build
Set environment variables to connect to a single GA4 property:
GA4_PROPERTY_ID=123456789
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json
For OAuth credentials instead of a service account:
GA4_PROPERTY_ID=123456789
GA4_CREDENTIALS_FILE=/path/to/oauth-credentials.json
Create a config.json in the project root to map multiple GA4 properties to project directories. The server auto-detects which property to use based on the caller's working directory.
{
"credentials_file": "/path/to/oauth-credentials.json",
"clients": {
"client-a": {
"name": "Client A",
"folder": "/path/to/client-a/project",
"property_id": "123456789"
},
"client-b": {
"name": "Client B",
"folder": "/path/to/client-b/project",
"property_id": "987654321"
}
}
}
Single-property mode:
{
"mcpServers": {
"ga4": {
"command": "npx",
"args": ["mcp-ga4"],
"env": {
"GA4_PROPERTY_ID": "123456789",
"GOOGLE_APPLICATION_CREDENTIALS": "/path/to/credentials.json"
}
}
}
}
Multi-client mode:
{
"mcpServers": {
"ga4": {
"command": "node",
"args": ["/path/to/mcp-ga4/dist/index.js"]
}
}
}
Top pages:
dimensions=pagePath, metrics=screenPageViews, order_by=screenPageViews
Traffic sources:
dimensions=sessionSource,sessionMedium, metrics=sessions,totalUsers
Daily trend:
dimensions=date, metrics=sessions,totalUsers
Campaign performance:
dimensions=sessionCampaignName, metrics=sessions,conversions
Device breakdown:
dimensions=deviceCategory, metrics=sessions,totalUsers
| Tool | Description |
|------|-------------|
| ga4_get_client_context | Returns the active GA4 property ID and client name |
| ga4_run_report | Run a standard GA4 report with dimensions, metrics, date range, and filters |
| ga4_realtime_report | Query realtime data (last 30 minutes) |
| ga4_list_custom_dimensions | List all custom dimensions for the property |
| ga4_create_custom_dimension | Create a new custom dimension |
| ga4_list_custom_metrics | List all custom metrics for the property |
| ga4_list_data_streams | List web/app data streams and their measurement IDs |
| ga4_send_feedback | Submit feedback on a query result |
| ga4_suggest_improvement | Suggest a new query pattern or improvement |
Use YYYY-MM-DD for absolute dates, or these relative shortcuts:
todayyesterday7daysAgo30daysAgo90daysAgoDimensions: date, dateHour, eventName, pagePath, pageTitle, sessionSource, sessionMedium, sessionCampaignName, country, city, deviceCategory, browser, operatingSystem, landingPage, pageReferrer, newVsReturning, firstUserSource, firstUserMedium, firstUserCampaignName
Metrics: sessions, totalUsers, newUsers, activeUsers, screenPageViews, eventCount, conversions, engagedSessions, engagementRate, averageSessionDuration, bounceRate, sessionsPerUser, screenPageViewsPerSession, userEngagementDuration