{"_id":"@renzo.johnson/ga4-mcp","_rev":"4-7956fbf4bc4b556b1a5e63193c1bc15d","name":"@renzo.johnson/ga4-mcp","dist-tags":{"latest":"26.11.15"},"versions":{"26.11.13":{"name":"@renzo.johnson/ga4-mcp","version":"26.11.13","keywords":["mcp","mcp-server","model-context-protocol","ga4","google-analytics","analytics","claude","cursor","ai-agents"],"author":{"url":"https://renzojohnson.com","name":"Renzo Johnson"},"license":"MIT","_id":"@renzo.johnson/ga4-mcp@26.11.13","maintainers":[{"name":"renzo.johnson","email":"renzo.johnson@gmail.com"}],"homepage":"https://renzojohnson.com/contributions/ga4-mcp","bugs":{"url":"https://renzojohnson.com/contact"},"bin":{"ga4-mcp":"server.js"},"dist":{"shasum":"492be40a8a555834269bb0ac71464ca5b661f5c4","tarball":"https://registry.npmjs.org/@renzo.johnson/ga4-mcp/-/ga4-mcp-26.11.13.tgz","fileCount":5,"integrity":"sha512-vq7xNe88cilwm5cInxGz53epyhEmLZfblSkj71XxRfINu2XdESEfdlR0ZtxQFrOJtG+HD7eU2yF7croZu1Zb3Q==","signatures":[{"sig":"MEUCIDvCY9CVGK7XZWWv18iy2wO2CGAaoOAy+TJAE9sqjG3BAiEAv1iY8/LZ+ghZ2T+rR+7GocFe9iFv817hYNVt3/YmleU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIGvjDzQ9sgI91pdX+RT6SujSDe5MiYoRofFgTg0GLBPhAiEA6bZ66aMgrtJeiIlMRULYIs/f5ZFYsJ1n0gx/OIqfNlg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6202329},"_from":"file:/srv/www/projects/ga4-mcp/renzo.johnson-ga4-mcp-26.11.13.tgz","engines":{"node":">=22"},"mcpName":"com.renzojohnson/ga4-mcp","_npmUser":{"name":"renzo.johnson","email":"renzo.johnson@gmail.com"},"_resolved":"/srv/www/projects/ga4-mcp/renzo.johnson-ga4-mcp-26.11.13.tgz","_integrity":"sha512-vq7xNe88cilwm5cInxGz53epyhEmLZfblSkj71XxRfINu2XdESEfdlR0ZtxQFrOJtG+HD7eU2yF7croZu1Zb3Q==","_npmVersion":"12.2.2","description":"GA4 Analytics MCP server for Claude Code, Cursor and any MCP client. Google Analytics 4 reports and admin, plus Search Console.","directories":{},"_nodeVersion":"26.13.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ga4-mcp_26.11.13_1794526645655_0.1827114293921196","host":"s3://npm-registry-packages-npm-production"}},"26.11.15":{"_id":"@renzo.johnson/ga4-mcp@26.11.15","bin":{"ga4-mcp":"server.js"},"bugs":{"url":"https://renzojohnson.com/contact"},"dist":{"shasum":"d73ee4f077daabc88e6101476affa7b059f54248","tarball":"https://registry.npmjs.org/@renzo.johnson/ga4-mcp/-/ga4-mcp-26.11.15.tgz","fileCount":5,"integrity":"sha512-O0PxH6n6gV/jd0aqDWFjF1PZj8FR9LaUXPkxjeRT5nbZvGZz0NV+cQ9UJDv/zbxckd4GXsYEGDtjRc4OHYu1wg==","signatures":[{"sig":"MEQCIDzGI3TVw3bHYhdKZLEfGFWUSC6/J/zViufyKWJn5B3KAiBJx0awL/pT9i1/G7jfiQXHw2MIc1GnurLwOgbK79Sfmw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC8of5CnTQ1iF0Q9Gq00r9uaAHM2inIuqieZGjsSFv0FgIhAMK7xTVZZyX8huwefFhuVMy8/F0rk9TD5RzTaedA0TAl"}],"unpackedSize":6202366},"name":"@renzo.johnson/ga4-mcp","_from":"file:ga4-mcp-26.11.15.tgz","author":{"url":"https://renzojohnson.com","name":"Renzo Johnson"},"engines":{"node":">=22"},"license":"MIT","mcpName":"com.renzojohnson/ga4-mcp","scripts":{"start":"node server.js"},"version":"26.11.15","_npmUser":{"name":"renzo.johnson","email":"renzo.johnson@gmail.com"},"homepage":"https://renzojohnson.com/contributions/ga4-mcp","keywords":["mcp","mcp-server","model-context-protocol","ga4","google-analytics","analytics","claude","cursor","ai-agents"],"_resolved":"/private/tmp/mcprush-claims/ga4-mcp-26.11.15.tgz","_integrity":"sha512-O0PxH6n6gV/jd0aqDWFjF1PZj8FR9LaUXPkxjeRT5nbZvGZz0NV+cQ9UJDv/zbxckd4GXsYEGDtjRc4OHYu1wg==","_npmVersion":"11.12.1","description":"GA4 Analytics MCP server for Claude Code, Cursor and any MCP client. Google Analytics 4 reports and admin, plus Search Console. mcprush.com-3d68220a1674c7ebe44e5772","directories":{},"maintainers":[{"name":"renzo.johnson","email":"renzo.johnson@gmail.com"}],"_nodeVersion":"25.9.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ga4-mcp_26.11.15_1794753697651_0.9298992469334061"}}},"time":{"created":"2026-11-12T23:34:17.249Z","modified":"2026-11-15T14:41:37.933Z","0.0.0-stage":"2026-11-12T23:34:17.249Z","26.11.13":"2026-11-12T23:37:25.777Z","26.11.15":"2026-11-15T14:41:37.759Z"},"bugs":{"url":"https://renzojohnson.com/contact"},"author":{"url":"https://renzojohnson.com","name":"Renzo Johnson"},"license":"MIT","homepage":"https://renzojohnson.com/contributions/ga4-mcp","keywords":["mcp","mcp-server","model-context-protocol","ga4","google-analytics","analytics","claude","cursor","ai-agents"],"description":"GA4 Analytics MCP server for Claude Code, Cursor and any MCP client. Google Analytics 4 reports and admin, plus Search Console. mcprush.com-3d68220a1674c7ebe44e5772","maintainers":[{"name":"renzo.johnson","email":"renzo.johnson@gmail.com"}],"readme":"# GA4 Analytics MCP\n\nGA4 Analytics MCP server for Claude Code, Cursor and any MCP client. Google Analytics 4 reports and admin, plus Search Console.\n\n```bash\nnpx -y @renzo.johnson/ga4-mcp\n```\n\nThe server speaks MCP over stdio. It needs Node.js 22 or newer. Prefer VS Code? Install the [GA4 Analytics MCP extension](https://marketplace.visualstudio.com/items?itemName=mercurial.ga4-mcp): it signs you in with a wizard and registers the server with 8 AI agents.\n\n## Sign in\n\nThe server uses the first credential it finds:\n\n1. **An OAuth user**: set `GOOGLE_OAUTH_CLIENT_ID`, `GOOGLE_OAUTH_CLIENT_SECRET` and `GOOGLE_OAUTH_REFRESH_TOKEN`. Set all three or none; a partial set stops the server with an error naming what is missing.\n2. **`GOOGLE_APPLICATION_CREDENTIALS`**: path to a service-account key or an `authorized_user` JSON file.\n3. **Application Default Credentials** from the gcloud CLI:\n\n```bash\ngcloud auth application-default login --scopes=https://www.googleapis.com/auth/analytics.edit,https://www.googleapis.com/auth/analytics.readonly,https://www.googleapis.com/auth/indexing,https://www.googleapis.com/auth/webmasters\n```\n\nThe OAuth refresh token (or service account) needs these scopes:\n\n- `https://www.googleapis.com/auth/analytics.edit`\n- `https://www.googleapis.com/auth/analytics.readonly`\n- `https://www.googleapis.com/auth/indexing`\n- `https://www.googleapis.com/auth/webmasters`\n\n## Claude Code\n\nAdd it from the command line:\n\n```bash\nclaude mcp add ga4-analytics -- npx -y @renzo.johnson/ga4-mcp\n```\n\nOr add it to `.mcp.json` in your project (or `~/.claude.json` for every project).\n\n## Cursor\n\nAdd it to `~/.cursor/mcp.json` (or `.cursor/mcp.json` in a project).\n\n## Configuration\n\nClaude Code and Cursor use the same JSON shape:\n\n**With Application Default Credentials (gcloud):**\n\n```json\n{\n  \"mcpServers\": {\n    \"ga4-analytics\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\",\n        \"@renzo.johnson/ga4-mcp\"\n      ]\n    }\n  }\n}\n```\n**With an OAuth user:**\n\n```json\n{\n  \"mcpServers\": {\n    \"ga4-analytics\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\",\n        \"@renzo.johnson/ga4-mcp\"\n      ],\n      \"env\": {\n        \"GOOGLE_OAUTH_CLIENT_ID\": \"your-client-id.apps.googleusercontent.com\",\n        \"GOOGLE_OAUTH_CLIENT_SECRET\": \"your-client-secret\",\n        \"GOOGLE_OAUTH_REFRESH_TOKEN\": \"your-refresh-token\"\n      }\n    }\n  }\n}\n```\n**With a service-account key:**\n\n```json\n{\n  \"mcpServers\": {\n    \"ga4-analytics\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\",\n        \"@renzo.johnson/ga4-mcp\"\n      ],\n      \"env\": {\n        \"GOOGLE_APPLICATION_CREDENTIALS\": \"/path/to/service-account.json\"\n      }\n    }\n  }\n}\n```\n\n## Available Tools\n\nOnce set up, your AI agents have access to these tools:\n\n### GA4 Tools\n\n| Tool | What It Does | Example Prompt |\n|------|-------------|----------------|\n| `ping` | Check server connectivity | \"Ping the GA4 MCP server\" |\n| `get_account_summaries` | List all GA4 accounts/properties | \"Show me all my GA4 properties\" |\n| `get_property_details` | Property metadata (name, timezone, currency) | \"What timezone is property 371242449 set to?\" |\n| `list_google_ads_links` | Google Ads integrations for a property | \"Show Google Ads links for my property\" |\n| `run_report` | Full GA4 report (dimensions, metrics, filters) | \"Top 10 pages by sessions, last 7 days\" |\n| `run_realtime_report` | Live/realtime analytics data | \"How many users are on my site right now?\" |\n| `get_custom_dimensions_and_metrics` | Custom dimensions/metrics for a property | \"List custom dimensions for property 371242449\" |\n\n### Google Search Console Tools\n\n| Tool | What It Does | Example Prompt |\n|------|-------------|----------------|\n| `gsc_list_sites` | List all verified GSC properties | \"Show me all my Search Console sites\" |\n| `gsc_search_analytics` | Query search performance (clicks, impressions, CTR, position) | \"What are my top keywords for the last 28 days?\" |\n| `gsc_inspect_url` | Check index status, crawl info, mobile usability | \"Is https://example.com/page indexed by Google?\" |\n| `gsc_list_sitemaps` | List submitted sitemaps and their status | \"Show me the sitemaps for my site\" |\n\n### Example Prompts\n\n```\nShow me my top 10 landing pages by sessions for the last 30 days\n\nCompare traffic this week vs last week: sessions and pageviews by day\n\nWhat are my top traffic sources? Show source/medium with sessions and bounce rate\n\nHow many active users do I have right now?\n\nWhat keywords is my site ranking for? Show clicks, impressions, and average position\n\nWhich pages have the highest CTR in Google Search?\n\nIs https://example.com/my-page indexed by Google?\n\nShow me all submitted sitemaps and their status\n```\n\n**Pro tips:**\n- You don't need to know the exact API field names, just describe what you want\n- The agent will figure out the right dimensions, metrics, and date ranges\n- For complex reports, be specific: \"sessions by country, filtered to organic traffic, last 90 days, sorted descending\"\n- For GSC, use your site URL as it appears in Search Console (e.g., `https://example.com/` or `sc-domain:example.com`)\n\n## Privacy\n\nThe server sends no telemetry. It talks only to Google APIs, with your own credentials.\n\n## Links\n\n- [Documentation](https://renzojohnson.com/contributions/ga4-mcp)\n- [VS Code extension](https://marketplace.visualstudio.com/items?itemName=mercurial.ga4-mcp)\n- [Report an Issue](https://renzojohnson.com/contact)\n\n**By [Renzo Johnson](https://renzojohnson.com/contributions/ga4-mcp)** | MIT License\n","readmeFilename":"README.md"}