Skip to content
MCP server

Ga4

Google Analytics 4 MCP: reports, realtime data, custom dimensions, data streams.

Runs locallyStatus and history
Pricing
Open source
Runs
Locally
Version
2.0.1
Listing updated
4 days ago

About Ga4

Ga4 is an open-source MCP server for analytics and data. It runs locally on your machine and is started by your AI client.

Install

Run in a terminal

claude mcp add ga4 --env GA4_PROPERTY_ID='<GA4_PROPERTY_ID>' --env GOOGLE_APPLICATION_CREDENTIALS='<GOOGLE_APPLICATION_CREDENTIALS>' -- npx -y mcp-ga4

Add to claude_desktop_config.json

{
  "mcpServers": {
    "ga4": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-ga4"
      ],
      "env": {
        "GA4_PROPERTY_ID": "<GA4_PROPERTY_ID>",
        "GOOGLE_APPLICATION_CREDENTIALS": "<GOOGLE_APPLICATION_CREDENTIALS>"
      }
    }
  }
}

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "ga4": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-ga4"
      ],
      "env": {
        "GA4_PROPERTY_ID": "<GA4_PROPERTY_ID>",
        "GOOGLE_APPLICATION_CREDENTIALS": "<GOOGLE_APPLICATION_CREDENTIALS>"
      }
    }
  }
}

Add to .vscode/mcp.json

{
  "servers": {
    "ga4": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "mcp-ga4"
      ],
      "env": {
        "GA4_PROPERTY_ID": "<GA4_PROPERTY_ID>",
        "GOOGLE_APPLICATION_CREDENTIALS": "<GOOGLE_APPLICATION_CREDENTIALS>"
      }
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "ga4": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-ga4"
      ],
      "env": {
        "GA4_PROPERTY_ID": "<GA4_PROPERTY_ID>",
        "GOOGLE_APPLICATION_CREDENTIALS": "<GOOGLE_APPLICATION_CREDENTIALS>"
      }
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "ga4": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-ga4"
      ],
      "env": {
        "GA4_PROPERTY_ID": "<GA4_PROPERTY_ID>",
        "GOOGLE_APPLICATION_CREDENTIALS": "<GOOGLE_APPLICATION_CREDENTIALS>"
      }
    }
  }
}

Configuration

  • GA4_PROPERTY_IDGA4 property ID (numeric)Required
  • GOOGLE_APPLICATION_CREDENTIALSPath to service account JSON credentials fileRequired

Pricing

Open source

Ga4 FAQ

Is Ga4 free?

Yes. Ga4 is open source, so you can use and self-host it for free.

How do I add Ga4 to Claude Code?

Run this command in your terminal: claude mcp add ga4 --env GA4_PROPERTY_ID='<GA4_PROPERTY_ID>' --env GOOGLE_APPLICATION_CREDENTIALS='<GOOGLE_APPLICATION_CREDENTIALS>' -- npx -y mcp-ga4

What are the best alternatives to Ga4?

The closest alternatives to Ga4 are Agent-Native Analytics, Google Ads + Meta Ads + SEO/GEO MCP, Tapetide - Indian Stock Market MCP, World Monitor and CompanyData.

Alternatives to Ga4

  1. Open-source analytics app where an AI agent builds charts and dashboards from your data

    • Remote
    • Open source
    • 7.7K GitHub stars
    • Analytics and data
  2. Hosted MCP connector for managing Google Ads, Meta Ads, GA4 and Search Console from chat

    • 8 tools
    • Remote
    • Freemium
    • 8.1K GitHub stars
    • Marketing and SEO
  3. Indian NSE and BSE stock market data for AI assistants through 48 MCP tools

    • 17 tools
    • Remote
    • Freemium
    • 150 GitHub stars
    • Finance and payments
  4. World Monitor

    MCP server

    Live geopolitical intelligence dashboard with an API and MCP server for agents

    • Remote
    • Freemium
    • Analytics and data
  5. CompanyData

    MCP server

    Search and enrich company records from official registers via the CompanyData API

    • 3 tools
    • Remote
    • Paid
    • 3 GitHub stars
    • Analytics and data
  6. ChartAnt

    MCP server

    Remote MCP server returning charts, maps and dashboards as hosted PNG links

    • 51 tools
    • Remote
    • Freemium
    • Design and media