MCP ServerSTDIOOfficialv0.1.1

Google Analytics 4 MCP Server

Manage GA4 properties, data streams, conversions, and run analytics reports directly via Google's Admin and Data APIs. For developers integrating Google Analytics into applications or automating GA4 configuration and reporting workflows.

io.github.stucchi/google-analytics

Hosted URL

Local install

Transport

STDIO

Auth

No auth required

What the Google Analytics 4 MCP server does

How models use it and what it is built for.

Manage GA4 properties, data streams, conversions, and run analytics reports directly via Google's Admin and Data APIs. For developers integrating Google Analytics into applications or automating GA4 configuration and reporting workflows.

Connect to Google Analytics 4

Local install — runs as a subprocess.

uvx google-analytics-4-mcp==0.1.1

Environment variables

Configuration this server reads at startup.

  • GA_CREDENTIALS

    Google Service Account JSON key content (copy-paste the entire JSON)

  • GA_CREDENTIALS_PATH

    Alternative: path to the Service Account JSON key file

Resources

Where to find authoritative docs and source for Google Analytics 4.

Example prompts for Google Analytics 4

Paste any of these into Agent Studio after connecting Google Analytics 4.

  • List all GA4 properties and their data streams in my account
  • Run a report showing page views and conversions for the last 30 days
  • Create a new data stream for my web property
  • What conversions are currently configured for property ID 123456789

Google Analytics 4 MCP server — FAQ

Common questions about connecting and running Google Analytics 4.

  • How do I authenticate this MCP server with Google Analytics?

    Set the GA_CREDENTIALS environment variable with your Google Service Account JSON key (copy-paste the entire JSON), or use GA_CREDENTIALS_PATH to point to the key file. You can generate a Service Account key in the Google Cloud Console.

  • What can I do with this server?

    You can manage GA4 properties and data streams, configure conversions, and run analytics reports using Google's Admin and Data APIs. It's designed for automating GA4 setup and retrieving reporting data programmatically.

  • Do I need a Google Cloud project to use this?

    Yes, you need a Google Cloud project with the Google Analytics Admin API and Google Analytics Data API enabled, plus a Service Account with appropriate permissions to your GA4 properties.

  • Can I run custom reports with specific metrics and dimensions?

    Yes, the server uses Google's Data API to run reports. Refer to the Google Analytics Data API documentation for supported metrics, dimensions, and filtering options available for your queries.

  • What's the difference between GA_CREDENTIALS and GA_CREDENTIALS_PATH?

    GA_CREDENTIALS accepts the full Service Account JSON key as a string (useful for environment variables in CI/CD), while GA_CREDENTIALS_PATH points to a file path where the key is stored. Use whichever fits your deployment setup.

Skip the local setup — run MCP in your browser

MCP Playground runs 10,000+ hosted MCP servers — GitHub, Linear, Notion, Stripe, Sentry and more — across Claude, GPT, Gemini, DeepSeek and 40+ AI models. Compare model answers side-by-side, save agent presets, share runs. Zero install.

Open Agent Studio

Related servers

More on MCP Playground