Google Analytics MCP Server

Google Analytics MCP server for accessing web analytics data

Local serverstdioTypeScript

What is the Google Analytics MCP Server?

Google analytics mcp server lets Claude, Cursor and other MCP clients work with Google Analytics directly. Google Analytics MCP server for accessing web analytics data.

What Google Analytics does

An MCP server implementation for accessing Google Analytics 4 (GA4) data, built using the Model Context Protocol TypeScript SDK.

Key capabilities

  • Get page view metrics with customizable dimensions
  • Track active and new users over time
  • Analyze specific events and their metrics
  • Monitor user behavior metrics (session duration, bounce rate)
  • Flexible date range selection for all queries

Requirements

  • Node.js 20 or higher - A Google Analytics 4 property. - A Google Cloud project with the Analytics Data API enabled. - A service account with credentials to access the API.

Practical notes

  • Maintained by ruchernchong, written in TypeScript.

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
runReport
getPageViews
getActiveUsers
getEvents
getUserBehavior

How to install the Google Analytics MCP Server

{
  "mcpServers": {
    "google-analytics": {
      "command": "npx",
      "args": ["-y", "mcp-server-google-analytics"],
      "env": {
        "GOOGLE_CLIENT_EMAIL": "your-service-account@project.iam.gserviceaccount.com",
        "GOOGLE_PRIVATE_KEY": "your-private-key",
        "GA_PROPERTY_ID": "your-ga4-property-id"
      }
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

  • Node.js 20 or higher - A Google Analytics 4 property. - A Google Cloud project with the Analytics Data API enabled. - A service account with credentials to access the API.
VariableDescriptionRequired
GOOGLE_CLIENT_EMAILConfiguration value read at startup.Optional
GOOGLE_PRIVATE_KEYCredential the server authenticates with.Yes
GA_PROPERTY_IDConfiguration value read at startup.Optional

Example prompts to try

  • “Use Google Analytics to runReport.”
  • “Use Google Analytics to getPageViews.”
  • “Use Google Analytics to getActiveUsers.”

Frequently asked questions

Google Analytics MCP server for accessing web analytics data Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.