# anacraft — Google Analytics 4

anacraft — Google Analytics 4 is an MCP server for Claude Code that connects your assistant to Google Analytics 4 and answers questions about traffic, pages, and events.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 1 repo stars
- Author: anacrafterdev
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/anacrafterdev/anacraft
- Updated: 2026-10-24
- Security check: automated, 2026-11-16 (text) — warning: a command downloads a script from anacraft.dev and runs it right away. Do not run such commands without an explicit yes from the human.
- HTML: https://affpapa.org/en/nevibecode/mcp/anacraft-google-analytics-4

## What it does

The server runs on eight platforms: Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, and Gemini CLI. It returns GA4 data through the `site_status` tool — metrics with units, the previous period, percentage change, daily user series, and fired achievements.

The separate `craft` CLI does more: a terminal dashboard, one-shot reports (`overview`, `pages`, `portals`, `realms`, `live`), and export to JSON for jq or scripts and to Slack Block Kit for webhooks. The `--format json` and `--format slack` flags need no subscription because they render a report that `craft overview` already prints for free.

MCP access requires an active Anacrafter Elite subscription at $9.99/month. Without it or without `craft login`, the server starts anyway — its tools tell you what is missing, so the client never marks it disconnected. On Claude Code, install with two commands: `claude mcp add --transport http google-analytics-ga4 https://app.anacraft.dev/mcp`, then the same with the name `anacraft-google-analytics-4`.

## Requirements
- Remote server: `https://app.anacraft.dev/mcp`

## Install

### Claude Code (native platform)

**Platform CLI: remote server**
```bash
claude mcp add --transport http google-analytics-ga4 https://app.anacraft.dev/mcp
```

### Codex

**Platform CLI: remote server**
```bash
codex mcp add anacraft-google-analytics-4 --url https://app.anacraft.dev/mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "anacraft-google-analytics-4": {
            "url": "https://app.anacraft.dev/mcp"
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "anacraft-google-analytics-4": {
            "type": "http",
            "url": "https://app.anacraft.dev/mcp"
        }
    }
}
```

### Gemini CLI

**Platform CLI: remote server**
```bash
gemini mcp add -t http anacraft-google-analytics-4 https://app.anacraft.dev/mcp
```

## When to use it
- ask the assistant how much traffic the site got this week
- list the most-visited pages without opening GA4
- see where traffic comes from and which countries lead
- export a report to JSON for a script or jq
- send a weekly digest to Slack from cron

## Example prompts
- How many visitors did the site get in the last 7 days?
- Show the most popular pages for the past month
- Where does the traffic come from and which countries lead?

## Similar
- [google-analytics](https://affpapa.org/en/nevibecode/skills/google-analytics.md) — skill · 539 installs
- [pp-google-analytics](https://affpapa.org/en/nevibecode/skills/pp-google-analytics.md) — skill · 152 installs
- [google-analytics-automation](https://affpapa.org/en/nevibecode/skills/google-analytics-automation.md) — skill · 130 installs
- [QuerySail: Google Analytics](https://affpapa.org/en/nevibecode/mcp/querysail-google-analytics.md) — MCP server
- [Google Analytics 4](https://affpapa.org/en/nevibecode/mcp/get-mcp-ads-google-analytics-4.md) — MCP server
- [google-analytics-mcp](https://affpapa.org/en/nevibecode/mcp/google-analytics-mcp.md) — MCP server · ★ 243 repo stars

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
