Price Per TokenPrice Per Token

Analytics MCP Server

by googleanalytics

0

About

Google Analytics MCP Server is an official MCP integration that connects AI assistants to Google Analytics, enabling retrieval of account data, property details, and comprehensive reports directly through the Google Analytics Data API and Admin API. Key features of Google Analytics MCP Server: - Retrieve account summaries and property details from Google Analytics - Access Google Ads links associated with Analytics properties - Run standard reports using Google Analytics 4 Data API with custom dimensions and metrics - Execute real-time reports showing current website activity and user behavior - Query custom dimensions and metrics defined for specific properties

README

Google Analytics MCP Server (Experimental)

[](https://pypi.org/project/analytics-mcp/) [](https://www.python.org/downloads/) [](https://github.com/googleanalytics/google-analytics-mcp/actions?query=branch%3Amain++) [](https://pypi.org/project/analytics-mcp/) [](https://github.com/googleanalytics/google-analytics-mcp/stargazers) [](https://github.com/googleanalytics/google-analytics-mcp/network/members) [](https://www.youtube.com/watch?v=PT4wGPxWiRQ)

This repo contains the source code for running a local MCP server that interacts with APIs for Google Analytics.

Join the discussion and ask questions in the 🤖-analytics-mcp channel on Discord.

Tools 🛠️

The server uses the Google Analytics Admin API and Google Analytics Data API to provide several Tools for use with LLMs.

Retrieve account and property information 🟠

  • get_account_summaries: Retrieves information about the user's Google
  • Analytics accounts and properties.
  • get_property_details: Returns details about a property.
  • list_google_ads_links: Returns a list of links to Google Ads accounts for
  • a property.

    Run core reports 📙

  • run_report: Runs a Google Analytics report using the Data API.
  • get_custom_dimensions_and_metrics: Retrieves the custom dimensions and
  • metrics for a specific property.

    Run realtime reports ⏳

  • run_realtime_report: Runs a Google Analytics realtime report using the
  • Data API.

    Setup instructions 🔧

    ✨ Watch the Google Analytics MCP Setup Tutorial on YouTube for a step-by-step walkthrough of these instructions.

    [](https://www.youtube.com/watch?v=nS8HLdwmVlY)

    Setup involves the following steps:

    1. Configure Python. 1. Configure credentials for Google Analytics. 1. Configure Gemini.

    Configure Python 🐍

    Install pipx.

    Enable APIs in your project ✅

    Follow the instructions to enable the following APIs in your Google Cloud project:

  • Google Analytics Admin API
  • Google Analytics Data API
  • Configure credentials 🔑

    Configure your Application Default Credentials (ADC). Make sure the credentials are for a user with access to your Google Analytics accounts or properties.

    Credentials must include the Google Analytics read-only scope:

    https://www.googleapis.com/auth/analytics.readonly
    

    Check out Manage OAuth Clients for how to create an OAuth client.

    Here are some sample gcloud commands you might find useful:

  • Set up ADC using user credentials and an OAuth desktop or web client after
  • downloading the client JSON to YOUR_CLIENT_JSON_FILE.

      gcloud auth application-default login \
        --scopes https://www.googleapis.com/auth/analytics.readonly,https://www.googleapis.com/auth/cloud-platform \
        --client-id-file=YOUR_CLIENT_JSON_FILE
      

  • Set up ADC using service account impersonation.
  •   gcloud auth application-default login \
        --impersonate-service-account=SERVICE_ACCOUNT_EMAIL \
        --scopes=https://www.googleapis.com/auth/analytics.readonly,https://www.googleapis.com/auth/cloud-platform
      

    When the gcloud auth application-default command completes, copy the PATH_TO_CREDENTIALS_JSON file location printed to the console in the following message. You'll need this for the next step!

    Credentials saved to file: [PATH_TO_CREDENTIALS_JSON]
    

    Configure Gemini

    1. Install Gemini CLI or Gemini Code Assist.

    1. Create or edit the file at ~/.gemini/settings.json, adding your

    Related MCP Servers

    AI Research Assistant

    AI Research Assistant

    hamid-vakilzadeh

    AI Research Assistant provides comprehensive access to millions of academic papers through the Semantic Scholar and arXiv databases. This MCP server enables AI coding assistants to perform intelligent literature searches, citation network analysis, and paper content extraction without requiring an API key. Key features include: - Advanced paper search with multi-filter support by year ranges, citation thresholds, field of study, and publication type - Title matching with confidence scoring for finding specific papers - Batch operations supporting up to 500 papers per request - Citation analysis and network exploration for understanding research relationships - Full-text PDF extraction from arXiv and Wiley open-access content (Wiley TDM token required for institutional access) - Rate limits of 100 requests per 5 minutes with options to request higher limits through Semantic Scholar

    Web & Search
    12 8
    Linkup

    Linkup

    LinkupPlatform

    Linkup is a real-time web search and content extraction service that enables AI assistants to search the web and retrieve information from trusted sources. It provides source-backed answers with citations, making it ideal for fact-checking, news gathering, and research tasks. Key features of Linkup: - Real-time web search using natural language queries to find current information, news, and data - Page fetching to extract and read content from any webpage URL - Search depth modes: Standard for direct-answer queries and Deep for complex research across multiple sources - Source-backed results with citations and context from relevant, trustworthy websites - JavaScript rendering support for accessing dynamic content on JavaScript-heavy pages

    Web & Search
    2 24
    Math-MCP

    Math-MCP

    EthanHenrickson

    Math-MCP is a computation server that enables Large Language Models (LLMs) to perform accurate numerical calculations through the Model Context Protocol. It provides precise mathematical operations via a simple API to overcome LLM limitations in arithmetic and statistical reasoning. Key features of Math-MCP: - Basic arithmetic operations: addition, subtraction, multiplication, division, modulo, and bulk summation - Statistical analysis functions: mean, median, mode, minimum, and maximum calculations - Rounding utilities: floor, ceiling, and nearest integer rounding - Trigonometric functions: sine, cosine, tangent, and their inverses with degrees and radians conversion support

    Developer Tools
    22 81