Cover image
Try Now
2025-03-26

Google Analytics MCP Server para acceder a los datos de análisis a través de herramientas y recursos

3 years

Works with Finder

1

Github Watches

0

Github Forks

0

Github Stars

Google Analytics MCP Server

A Model Context Protocol (MCP) server that provides access to Google Analytics data through tools and resources.

Test results (2024-03-26):

  • Total active users: 102,883
  • Belarus active users: 64,837 (63%)
  • Total page views: 2,422,925
  • Belarus page views: 1,950,160 (80%)

Features

  • Access Google Analytics metrics and dimensions through MCP resources
  • Fetch analytics data with flexible filtering options
  • Get formatted data with insights and recommendations
  • TypeScript implementation with strong typing

Installation

  1. Clone the repository
  2. Install dependencies
    npm install
    
  3. Create a .env file based on .env.example with your Google Analytics credentials
  4. Build the project
    npm run build
    

Setup Google Analytics Credentials

  1. Go to the Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable the Google Analytics Data API
  4. Create a service account with appropriate permissions
  5. Download the service account key (JSON format)
  6. Extract the client email and private key from the JSON file
  7. Add these to your .env file:
    GA_PROPERTY_ID=your_property_id
    GA_CLIENT_EMAIL=your-service-account@your-project.iam.gserviceaccount.com
    GA_PRIVATE_KEY=-----BEGIN PRIVATE KEY-----\nYourPrivateKeyHere\n-----END PRIVATE KEY-----
    

Usage

Running the Server

node build/index.js

MCP Configuration

Add the server to your cline_mcp_settings.json file:

{
  "mcpServers": {
    "google-analytics": {
      "command": "node",
      "args": ["/path/to/GAnalytics-MCP-server/build/index.js"],
      "env": {
        "GA_PROPERTY_ID": "your_property_id",
        "GA_CLIENT_EMAIL": "your-service-account@your-project.iam.gserviceaccount.com",
        "GA_PRIVATE_KEY": "-----BEGIN PRIVATE KEY-----\\nYourPrivateKeyHere\\n-----END PRIVATE KEY-----"
      }
    }
  }
}

Available Tools

get_analytics_data

Get Google Analytics data with optional filtering and analysis.

Parameters:

  • metrics (required): Array of metric names to fetch
  • dimensions (optional): Array of dimension names
  • startDate (required): Start date in YYYY-MM-DD format
  • endDate (required): End date in YYYY-MM-DD format
  • filters (optional): Object containing metric and dimension filters
  • orderBy (optional): Array of fields to sort by
  • limit (optional): Number of records to return
  • offset (optional): Index of first record to return

Example:

{
  "metrics": ["activeUsers", "newUsers"],
  "dimensions": ["country", "deviceCategory"],
  "startDate": "2023-01-01",
  "endDate": "2023-01-31",
  "filters": {
    "metrics": [
      {
        "metric": "activeUsers",
        "operation": "GREATER_THAN",
        "value": 10
      }
    ],
    "dimensions": [
      {
        "dimension": "country",
        "operation": "EXACT",
        "value": "United States"
      }
    ]
  },
  "orderBy": [
    {
      "field": "activeUsers",
      "desc": true
    }
  ],
  "limit": 10
}

Available Resources

analytics://metrics

List of available Google Analytics metrics.

analytics://dimensions

List of available Google Analytics dimensions.

analytics://reports/{reportId}

Access specific analytics report data.

Development

Running Tests

npm test

Building

npm run build

License

MIT

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • Yasir Eryilmaz
  • AI scriptwriting assistant for short, engaging video content.

  • apappascs
  • Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.

  • ShrimpingIt
  • Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx

  • huahuayu
  • Una puerta de enlace de API unificada para integrar múltiples API de explorador de blockchain similar a Esterscan con soporte de protocolo de contexto modelo (MCP) para asistentes de IA.

  • deemkeen
  • Controle su MBOT2 con un combo de potencia: MQTT+MCP+LLM

  • jae-jae
  • Servidor MCP para obtener contenido de la página web con el navegador sin cabeza de dramaturgo.

    Reviews

    4 (1)
    Avatar
    user_wPVE73Py
    2025-04-17

    GAnalytics-MCP-server by Kirill812 is a game-changer for monitoring and optimizing MCP applications. The integration is seamless, and the analytics provided are incredibly detailed, offering deep insights that have greatly improved our server performance. Highly recommended for anyone looking to leverage powerful analytics within their MCP server setup. Check it out!