Ga4 MCP Server
by mharnettio.github.mharnett/ga4v2.0.1
Google Analytics 4 MCP: reports, realtime data, custom dimensions, data streams.
context tax
queued
security
queued
cold start
queued
freshness
Active10d ago
Install Ga4 MCP server
Install in Claude Code
claude mcp add ga4-mharnett -e GA4_PROPERTY_ID='<ga4-property-id>' -e GOOGLE_APPLICATION_CREDENTIALS='<google-application-credentials>' -- npx -y mcp-ga4Install in Cursor
{
"mcpServers": {
"ga4-mharnett": {
"command": "npx",
"args": [
"-y",
"mcp-ga4"
],
"env": {
"GA4_PROPERTY_ID": "<ga4-property-id>",
"GOOGLE_APPLICATION_CREDENTIALS": "<google-application-credentials>"
}
}
}
}Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project).
Install in Claude Desktop
{
"mcpServers": {
"ga4-mharnett": {
"command": "npx",
"args": [
"-y",
"mcp-ga4"
],
"env": {
"GA4_PROPERTY_ID": "<ga4-property-id>",
"GOOGLE_APPLICATION_CREDENTIALS": "<google-application-credentials>"
}
}
}
}Settings → Developer → Edit Config (claude_desktop_config.json), then restart.
Install in VS Code
{
"servers": {
"ga4-mharnett": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-ga4"
],
"env": {
"GA4_PROPERTY_ID": "<ga4-property-id>",
"GOOGLE_APPLICATION_CREDENTIALS": "<google-application-credentials>"
}
}
}
}Add to .vscode/mcp.json in your workspace.
Install in Windsurf
{
"mcpServers": {
"ga4-mharnett": {
"command": "npx",
"args": [
"-y",
"mcp-ga4"
],
"env": {
"GA4_PROPERTY_ID": "<ga4-property-id>",
"GOOGLE_APPLICATION_CREDENTIALS": "<google-application-credentials>"
}
}
}
}Add to ~/.codeium/windsurf/mcp_config.json.
Configuration
| Variable | Required | Secret | Description |
|---|---|---|---|
| GA4_PROPERTY_ID | yes | — | GA4 property ID (numeric) |
| GOOGLE_APPLICATION_CREDENTIALS | yes | — | Path to service account JSON credentials file |
Freshness
Active — last maintenance signal 10d ago. The newest of the signals below sets the band.
Last commit (default branch)
2026-09-29 · 10d ago · GitHub
Latest release
2026-09-29 · 10d ago · GitHub · v2.3.0
Package published
no data · npm/PyPI
Registry entry updated
2026-04-08 · 6mo ago · official registry · v2.0.1
FAQ
›How do I install the Ga4 MCP server in Claude Code?
Run: claude mcp add ga4-mharnett -e GA4_PROPERTY_ID='<ga4-property-id>' -e GOOGLE_APPLICATION_CREDENTIALS='<google-application-credentials>' -- npx -y mcp-ga4. For Cursor, VS Code, Claude Desktop and Windsurf, use the install tabs above.
›Does Ga4 require an API key?
Yes. It expects GA4_PROPERTY_ID, GOOGLE_APPLICATION_CREDENTIALS.
›Can I use Ga4 as a remote (hosted) MCP server?
No hosted endpoint is published; it runs locally over stdio.
›Is Ga4 in the official MCP registry?
Yes, as io.github.mharnett/ga4.
Alternatives to Ga4
Other data & analytics MCP servers.