{"_id":"@saeedsakib/ga4-mcp","_rev":"2-4bb3cfc2ec33ba7aca630b25a09b160a","name":"@saeedsakib/ga4-mcp","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@saeedsakib/ga4-mcp","version":"0.1.0","keywords":["mcp","modelcontextprotocol","google-analytics","ga4","analytics","claude","cursor","codex"],"license":"Apache-2.0","_id":"@saeedsakib/ga4-mcp@0.1.0","maintainers":[{"name":"saeedsakib","email":"saeedsakib@icloud.com"}],"homepage":"https://github.com/msaeedsakib/ga4-mcp#readme","bugs":{"url":"https://github.com/msaeedsakib/ga4-mcp/issues"},"bin":{"ga4-mcp":"dist/index.js"},"dist":{"shasum":"166eda1f61a7eb3c8cec96a65f1f7c249f35dc78","tarball":"https://registry.npmjs.org/@saeedsakib/ga4-mcp/-/ga4-mcp-0.1.0.tgz","fileCount":6,"integrity":"sha512-uCYBUR1yoVaphcyt47uI+maf/uZGi3zMqn9lP2BRjG/ysiF7sb4jt9tTnvPdS7Va8rt9/QRVg52MRYq5NbK+FA==","signatures":[{"sig":"MEUCIQDAviN0S0enRnnlWtPkR9WklbCJ37JSscQm+qxHKeRgxAIgd5BBPm0fRr3g5MaKp0WjKyPIedvfaa2+pb4LDz5FkV8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":67997},"type":"module","engines":{"node":">=20.11"},"gitHead":"aae4fd444f3e215a73bf77d763b9ff83e22b65b3","scripts":{"test":"bun test","build":"rm -rf dist && bun build src/index.ts --target node --packages external --outdir dist","typecheck":"tsc --noEmit","prepublishOnly":"bun run typecheck && bun test && bun run build"},"_npmUser":{"name":"saeedsakib","email":"saeedsakib@icloud.com"},"repository":{"url":"git+https://github.com/msaeedsakib/ga4-mcp.git","type":"git"},"_npmVersion":"11.19.0","description":"Google Analytics 4 MCP server with a one-command service account setup for Claude Code, Cursor and Codex","directories":{},"_nodeVersion":"26.8.1","dependencies":{"zod":"^4.6.5","commander":"^15.0.0","picocolors":"^1.1.1","@inquirer/prompts":"^8.7.2","@google-analytics/data":"^7.2.0","@google-analytics/admin":"^10.1.0","@modelcontextprotocol/server":"^2.1.0"},"_hasShrinkwrap":false,"devDependencies":{"smol-toml":"^1.9.0","@types/bun":"^1.4.2","typescript":"^7.0.2","@types/node":"^26.6.2"},"_npmOperationalInternal":{"tmp":"tmp/ga4-mcp_0.1.0_1790200729404_0.4391531242517521","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"_id":"@saeedsakib/ga4-mcp@0.1.1","bin":{"ga4-mcp":"dist/index.js"},"bugs":{"url":"https://github.com/msaeedsakib/google-analytics-mcp-ts/issues"},"dist":{"shasum":"08ecd7f3bd4f654dfb1de550da0569f62ff777f7","tarball":"https://registry.npmjs.org/@saeedsakib/ga4-mcp/-/ga4-mcp-0.1.1.tgz","fileCount":6,"integrity":"sha512-VIcgDks8KdNxq5LyhtAaPl/z8UBwmNJL2cMaIE9nXZ8a4hobhCWLL2d/C5CDNiuXoYtFeRAVIlx0hKtYnyo4lg==","signatures":[{"sig":"MEQCIEjBEZLS/u6zSLzYb20C3J6G7QUxdK8jqrJCeUr21e/6AiASlNVAlLROP5sAVbS0NY8No9Uz7yWVDWkkVPVb/Xub5A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDd9kITRqKPFQydXRR6+BdAZ3jQ93Bnru8D2zja2FA7UAIgBgjxA47/FU5opjjgjihfJAM7YM8HOSMppaCo4vh0nPA="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@saeedsakib%2fga4-mcp@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":68061},"name":"@saeedsakib/ga4-mcp","type":"module","engines":{"node":">=20.11"},"gitHead":"ffd2edc18bb8f0ebd3caf6054cd2fbcb920f333f","license":"Apache-2.0","scripts":{"test":"bun test","build":"rm -rf dist && bun build src/index.ts --target node --packages external --outdir dist","typecheck":"tsc --noEmit","prepublishOnly":"bun run typecheck && bun test && bun run build"},"version":"0.1.1","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:892ad171-380e-4e96-b6ce-a6edd1a85b69"}},"homepage":"https://github.com/msaeedsakib/google-analytics-mcp-ts#readme","keywords":["mcp","modelcontextprotocol","google-analytics","ga4","analytics","claude","cursor","codex"],"repository":{"url":"git+https://github.com/msaeedsakib/google-analytics-mcp-ts.git","type":"git"},"_npmVersion":"12.1.0","description":"Google Analytics 4 MCP server with a one-command service account setup for Claude Code, Cursor and Codex","directories":{},"maintainers":[{"name":"saeedsakib","email":"saeedsakib@icloud.com"}],"_nodeVersion":"24.21.0","dependencies":{"zod":"^4.6.5","commander":"^15.0.0","picocolors":"^1.1.1","@inquirer/prompts":"^8.7.2","@google-analytics/data":"^7.2.0","@google-analytics/admin":"^10.1.0","@modelcontextprotocol/server":"^2.1.0"},"_hasShrinkwrap":false,"devDependencies":{"smol-toml":"^1.9.0","@types/bun":"^1.4.2","typescript":"^7.0.2","@types/node":"^26.6.2"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ga4-mcp_0.1.1_1790201235454_0.5138214236902054"}}},"time":{"created":"2026-09-23T21:58:49.190Z","modified":"2026-09-23T22:07:15.928Z","0.1.0":"2026-09-23T21:58:49.534Z","0.1.1":"2026-09-23T22:07:15.539Z"},"bugs":{"url":"https://github.com/msaeedsakib/google-analytics-mcp-ts/issues"},"license":"Apache-2.0","homepage":"https://github.com/msaeedsakib/google-analytics-mcp-ts#readme","keywords":["mcp","modelcontextprotocol","google-analytics","ga4","analytics","claude","cursor","codex"],"repository":{"url":"git+https://github.com/msaeedsakib/google-analytics-mcp-ts.git","type":"git"},"description":"Google Analytics 4 MCP server with a one-command service account setup for Claude Code, Cursor and Codex","maintainers":[{"name":"saeedsakib","email":"saeedsakib@icloud.com"}],"readme":"# ga4-mcp\n\nA Google Analytics 4 MCP server with a one-command setup. It is a TypeScript rewrite of Google's\n[google-analytics-mcp](https://github.com/googleanalytics/google-analytics-mcp). You don't need gcloud, Python,\nOAuth clients or env vars: give it a service account key and pick your agents.\n\n```bash\nnpx @saeedsakib/ga4-mcp setup\n```\n\nSetup does four things:\n\n1. Asks for the path to your service account JSON key and stores a copy in `~/.config/ga4-mcp/` (owner-only permissions).\n2. Checks access live. If an API isn't enabled or the service account can't see any property, it tells you exactly what to fix and waits while you do.\n3. Adds the MCP server to **Claude Code**, **Cursor** and/or **Codex**, and installs the bundled `ga4-mcp` skill so the agent knows how to query GA4 well.\n4. Prints a config snippet for any other MCP client or custom harness.\n\nRestart your agent and ask something like *\"How did organic traffic change over the last 28 days?\"*\n\n## Before you start: get a service account key\n\n1. In [Google Cloud Console](https://console.cloud.google.com/), pick or create a project and enable the\n   [Google Analytics Admin API](https://console.cloud.google.com/apis/library/analyticsadmin.googleapis.com) and the\n   [Google Analytics Data API](https://console.cloud.google.com/apis/library/analyticsdata.googleapis.com).\n2. Go to **IAM & Admin → Service Accounts → Create service account**. It needs no Cloud roles.\n3. Open the service account, go to **Keys → Add key → Create new key → JSON**, and download it.\n4. In Google Analytics, go to **Admin → Property access management → + → Add users**. Paste the service account email\n   (`…@….iam.gserviceaccount.com`), choose **Viewer** and save. Repeat for each property you want the agent to see.\n\nSetup checks each of these steps and tells you which one is missing.\n\n## Commands\n\n| Command | What it does |\n|---|---|\n| `npx @saeedsakib/ga4-mcp setup` | Store a key, verify access, configure agents |\n| `npx @saeedsakib/ga4-mcp status` | Show the stored key and configured agents, then re-check access |\n| `npx @saeedsakib/ga4-mcp remove` | Remove the server and skill from agents, and optionally delete the key |\n| `npx @saeedsakib/ga4-mcp` | Start the stdio MCP server (this is what agents run) |\n\n## Custom harnesses\n\nAny MCP client that can spawn a stdio server works. Run `setup` once to store the key, then point your client at:\n\n```json\n{\n  \"mcpServers\": {\n    \"ga4\": { \"command\": \"npx\", \"args\": [\"-y\", \"@saeedsakib/ga4-mcp\"] }\n  }\n}\n```\n\nGive your agent [`skills/ga4-mcp/SKILL.md`](skills/ga4-mcp/SKILL.md) as instructions if it supports skills or system prompts.\n\n## Tools\n\nAll tools are read-only and match upstream's tool names and arguments.\n\n| Tool | Description |\n|---|---|\n| `get_account_summaries` | Accounts and properties the service account can see |\n| `get_property_details` | Property settings (time zone, currency, …) |\n| `list_google_ads_links` | Google Ads accounts linked to a property |\n| `list_property_annotations` | Notes left on dates (releases, campaigns) |\n| `get_custom_dimensions_and_metrics` | A property's custom definitions |\n| `run_report` | Core Data API report |\n| `run_realtime_report` | Last 30 minutes of activity |\n| `run_funnel_report` | Funnel steps with drop-off, breakdowns and next actions |\n| `run_conversions_report` | Ad cost, ROAS and attributed conversions |\n\n## Where things are written\n\n| | Path |\n|---|---|\n| Key | `$XDG_CONFIG_HOME/ga4-mcp/service-account.json` (default `~/.config/…`, or `%APPDATA%\\ga4-mcp\\` on Windows) |\n| Claude Code | `~/.claude.json` → `mcpServers.ga4`, skill in `~/.claude/skills/ga4-mcp/` (respects `CLAUDE_CONFIG_DIR`) |\n| Cursor | `~/.cursor/mcp.json` → `mcpServers.ga4`, skill in `~/.cursor/skills/ga4-mcp/` |\n| Codex | `~/.codex/config.toml` → `[mcp_servers.ga4]`, skill in `~/.agents/skills/ga4-mcp/` (respects `CODEX_HOME`) |\n\nSetup only changes its own `ga4` entry and leaves the rest of each config file as it was.\n\n## Development\n\n```bash\nbun install\nbun test\nbun run typecheck\nbun run build\n```\n\nThe published package runs on Node 20.11 or later.\n\n## License\n\nApache-2.0. See [NOTICE](NOTICE) for attribution to the original Google project.\n","readmeFilename":"README.md"}