Tracking and data

GA4 via MCP and AI

The Google Analytics MCP server, launched by Google in July 2025, lets AI agents run direct queries against your GA4 data. Ask analysis questions in natural language without navigating GA4's complex interface.

You can

  • Run custom reports
  • Real-time data
  • Trend analysis
  • Combine with Google Ads

You need

  • Node.js
  • Google Cloud project
  • Service account

Watch out for

  • 2,500 row limit
  • Context window
  • Minimal permissions

What is the GA4 MCP server?

The GA4 MCP server is an official tool from the Google Analytics team that exposes GA4's reporting API through the Model Context Protocol. An AI agent can run GA4 reports, fetch real-time data and analyze conversion trends directly from a conversational interface.

The server is on GitHub as open source under the Apache 2.0 license. Version 0.4.0 from May 2026 is the latest stable version, with more than 2,000 GitHub stars and active maintenance from Google.

What can you do with GA4 MCP?

  • Run custom GA4 reports in natural language
  • Fetch real-time data for the last 30 minutes
  • Analyze traffic sources, conversion trends and user behavior
  • Combine GA4 data with Google Ads data for a full attribution analysis
  • Automate weekly and monthly reports

GA4 MCP vs the GA4 interface

GA4's interface is powerful but notoriously complex. Building an Explore report to answer a specific question can take 15 to 30 minutes. With GA4 MCP you can ask the same question in natural language and get the answer in seconds.

Setting up the GA4 MCP server

The installation requires Node.js, a Google Cloud project with the Analytics Data API enabled, and a service account with read permissions to your GA4 property. Stape offers a simplified guide for connecting GA4 MCP to Claude Desktop specifically.

Limitations to know about

Large data volumes can cause problems with the AI agent's context window. Queries that return more than 2,500 rows need aggregation. The service account should have minimal permissions, with read access only to the properties it needs.

Frequently asked questions

Is GA4 MCP an official tool?

Yes. It is an official tool from the Google Analytics team, open source under the Apache 2.0 license on GitHub.

What do I need to install it?

Node.js, a Google Cloud project with the Analytics Data API enabled, and a service account with read permissions to your GA4 property.

Are there any limits?

Queries that return more than 2,500 rows need aggregation, and the service account should only have read access to the properties it needs.

Want to talk it through?

Tell me what you are working on and I will get back to you with straight answers.

Let's talk