Google Analytics MCP Server
by leonardosepulvedatio.github.leonardosepulvedat/mcp-google-analyticsv1.3.0
GA4 MCP that reads AND writes: reports, funnels, audits, and server-side events. 26 tools.
context tax
queued
security
queued
cold start
queued
freshness
Maintained49d ago
Install Google Analytics MCP server
Install in Claude Code
claude mcp add google-analytics-leonardosepulvedat -e GA_SERVICE_ACCOUNT_JSON='<ga-service-account-json>' -e GA_API_SECRET='<ga-api-secret>' -- npx -y mcp-google-analyticsInstall in Cursor
{
"mcpServers": {
"google-analytics-leonardosepulvedat": {
"command": "npx",
"args": [
"-y",
"mcp-google-analytics"
],
"env": {
"GA_SERVICE_ACCOUNT_JSON": "<ga-service-account-json>",
"GA_API_SECRET": "<ga-api-secret>"
}
}
}
}Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project).
Install in Claude Desktop
{
"mcpServers": {
"google-analytics-leonardosepulvedat": {
"command": "npx",
"args": [
"-y",
"mcp-google-analytics"
],
"env": {
"GA_SERVICE_ACCOUNT_JSON": "<ga-service-account-json>",
"GA_API_SECRET": "<ga-api-secret>"
}
}
}
}Settings → Developer → Edit Config (claude_desktop_config.json), then restart.
Install in VS Code
{
"servers": {
"google-analytics-leonardosepulvedat": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-google-analytics"
],
"env": {
"GA_SERVICE_ACCOUNT_JSON": "<ga-service-account-json>",
"GA_API_SECRET": "<ga-api-secret>"
}
}
}
}Add to .vscode/mcp.json in your workspace.
Install in Windsurf
{
"mcpServers": {
"google-analytics-leonardosepulvedat": {
"command": "npx",
"args": [
"-y",
"mcp-google-analytics"
],
"env": {
"GA_SERVICE_ACCOUNT_JSON": "<ga-service-account-json>",
"GA_API_SECRET": "<ga-api-secret>"
}
}
}
}Add to ~/.codeium/windsurf/mcp_config.json.
Configuration
| Variable | Required | Secret | Description |
|---|---|---|---|
| GA_SERVICE_ACCOUNT_JSON | — | yes | Service account JSON for reading reports: file path or inline JSON (needed for read tools) |
| GA_PROPERTY_ID | — | — | Numeric GA4 property ID, e.g. 123456789 (needed for read tools) |
| GA_MEASUREMENT_ID | — | — | Measurement ID of the data stream, e.g. G-XXXXXXXXXX (needed for event-sending tools) |
| GA_API_SECRET | — | yes | Measurement Protocol API secret (needed for event-sending tools) |
Freshness
Maintained — last maintenance signal 49d ago. The newest of the signals below sets the band.
Last commit (default branch)
2026-08-21 · 49d ago · GitHub
Latest release
2026-08-21 · 50d ago · GitHub · v1.3.1
Package published
no data · npm/PyPI
Registry entry updated
2026-08-21 · 50d ago · official registry · v1.3.0
FAQ
›How do I install the Google Analytics MCP server in Claude Code?
Run: claude mcp add google-analytics-leonardosepulvedat -e GA_SERVICE_ACCOUNT_JSON='<ga-service-account-json>' -e GA_API_SECRET='<ga-api-secret>' -- npx -y mcp-google-analytics. For Cursor, VS Code, Claude Desktop and Windsurf, use the install tabs above.
›Does Google Analytics require an API key?
Yes. It expects GA_SERVICE_ACCOUNT_JSON, GA_API_SECRET, of which 2 are secrets.
›Can I use Google Analytics as a remote (hosted) MCP server?
No hosted endpoint is published; it runs locally over stdio.
›Is Google Analytics in the official MCP registry?
Yes, as io.github.leonardosepulvedat/mcp-google-analytics.
Alternatives to Google Analytics
Other data & analytics MCP servers.