ga4
v2.3.2Google Analytics 4 MCP: reports, realtime data, custom dimensions, data streams.
Values you need
| Variable | What it is | |
|---|---|---|
GA4_PROPERTY_ID | required | GA4 property ID (numeric) |
GOOGLE_APPLICATION_CREDENTIALS | required | Path to service account JSON credentials file |
npm (npx)
Requires Node.js 18+
Run in a terminal
claude mcp add ga4 -e 'GA4_PROPERTY_ID=<GA4_PROPERTY_ID>' -e 'GOOGLE_APPLICATION_CREDENTIALS=<GOOGLE_APPLICATION_CREDENTIALS>' -- npx -y mcp-ga4@2.3.2Add to
claude_desktop_config.json{
"mcpServers": {
"ga4": {
"args": [
"-y",
"mcp-ga4@2.3.2"
],
"command": "npx",
"env": {
"GA4_PROPERTY_ID": "<GA4_PROPERTY_ID>",
"GOOGLE_APPLICATION_CREDENTIALS": "<GOOGLE_APPLICATION_CREDENTIALS>"
}
}
}
}Add to
~/.cursor/mcp.json{
"mcpServers": {
"ga4": {
"args": [
"-y",
"mcp-ga4@2.3.2"
],
"command": "npx",
"env": {
"GA4_PROPERTY_ID": "<GA4_PROPERTY_ID>",
"GOOGLE_APPLICATION_CREDENTIALS": "<GOOGLE_APPLICATION_CREDENTIALS>"
}
}
}
}Add to
.vscode/mcp.json{
"inputs": [
{
"description": "GA4_PROPERTY_ID",
"id": "ga4-property-id",
"password": true,
"type": "promptString"
},
{
"description": "GOOGLE_APPLICATION_CREDENTIALS",
"id": "google-application-credentials",
"password": true,
"type": "promptString"
}
],
"servers": {
"ga4": {
"args": [
"-y",
"mcp-ga4@2.3.2"
],
"command": "npx",
"env": {
"GA4_PROPERTY_ID": "${input:ga4-property-id}",
"GOOGLE_APPLICATION_CREDENTIALS": "${input:google-application-credentials}"
},
"type": "stdio"
}
}
}Add to
~/.codex/config.toml[mcp_servers.ga4]
command = "npx"
args = ["-y", "mcp-ga4@2.3.2"]
env = { "GA4_PROPERTY_ID" = "<GA4_PROPERTY_ID>", "GOOGLE_APPLICATION_CREDENTIALS" = "<GOOGLE_APPLICATION_CREDENTIALS>" }For AI agents
- Ask the user for: GA4_PROPERTY_ID, GOOGLE_APPLICATION_CREDENTIALS. Never invent or guess these values; secrets go into the client config, not into chat logs.
- Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
- Restart or reload the client so it starts the server.
- If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.
Machine-readable: install.md · manifest.json