Google Analytics MCP Server

Researchstdio
Repository

Google's official MCP server for Google Analytics 4. Lets AI agents run reports against the GA4 Data API, discover dimensions and metrics, and explore account and property metadata with server-side aggregation and safe defaults. Runs locally (via pipx) and connects to MCP-compatible clients for conversational analysis of website traffic and user behavior.

Connect

Add this configuration to .claude/mcp.json

{
  "mcpServers": {
    "google-analytics": {
      "command": "npx",
      "args": [],
      "env": {
        "GOOGLE_APPLICATION_CREDENTIALS": "<YOUR_GOOGLE_APPLICATION_CREDENTIALS>"
      }
    }
  }
}

Tools (2)

run_report

Run a Google Analytics 4 report with the given metrics, dimensions, and date range.

{
  "type": "object",
  "required": [
    "property_id",
    "metrics"
  ],
  "properties": {
    "metrics": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Metrics to include (e.g. activeUsers, sessions)"
    },
    "date_range": {
      "type": "object",
      "description": "Start and end dates for the report"
    },
    "dimensions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Dimensions to break down by (e.g. country, deviceCategory)"
    },
    "property_id": {
      "type": "string",
      "description": "GA4 property ID"
    }
  }
}

get_property_details

Retrieve metadata and available dimensions/metrics for a GA4 property.

{
  "type": "object",
  "required": [
    "property_id"
  ],
  "properties": {
    "property_id": {
      "type": "string",
      "description": "GA4 property ID"
    }
  }
}

Resources

This server does not expose any resources.

Prompts

This server does not expose any prompts.

Server Information

Author
Google Analytics (@googleanalytics)
Repository
https://github.com/googleanalytics/google-analytics-mcp
Stars
0
Last Updated
July 12, 2026