google-analytics-mcp  by googleanalytics

Local server for Google Analytics data with LLMs

created 2 weeks ago

New!

373 stars

Top 77.1% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides an experimental local server for interacting with Google Analytics APIs, designed for use with Large Language Models (LLMs) like Gemini. It enables users to retrieve account summaries, property details, run core and real-time reports, and query custom dimensions and metrics, simplifying data access for AI-driven analysis.

How It Works

The server leverages the Google Analytics Admin API and Google Analytics Data API to expose functionalities as callable tools. It uses Application Default Credentials (ADC) for authentication, allowing integration with Google Cloud projects and user accounts with appropriate read-only scopes. The setup involves configuring Python, enabling specific Google APIs, and registering the server with an LLM environment like Gemini.

Quick Start & Requirements

  • Install: Configure Python, enable Google Analytics Admin API and Data API, and set up Application Default Credentials (ADC) with analytics.readonly scope.
  • Gemini Integration: Add the server configuration to ~/.gemini/settings.json.
  • Prerequisites: Python, pipx, Google Cloud project with enabled APIs, ADC configured for a user with Google Analytics access.
  • Docs: Contributing Guide

Highlighted Details

  • Supports retrieving account/property information, listing Google Ads links.
  • Enables running core reports and real-time reports via the Data API.
  • Facilitates querying custom dimensions and metrics for specific properties.
  • Designed for seamless integration with LLM-based workflows.

Maintenance & Community

This project is from the googleanalytics organization. Contribution guidelines are available.

Licensing & Compatibility

The repository does not explicitly state a license in the provided README. Users should verify licensing for commercial or closed-source use.

Limitations & Caveats

The server is marked as "Experimental," indicating potential instability or ongoing changes. Specific details on supported Google Analytics versions or data retention policies are not provided.

Health Check
Last commit

4 days ago

Responsiveness

Inactive

Pull Requests (30d)
19
Issues (30d)
7
Star History
411 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.