AC

ast-consulting/gsc-mcp

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

6 stars 5 forks 품질 58 트렌드 14

GA-MCP (Google Analytics Management Control Panel) is a lightweight Node.js package that provides developers with a structured interface to interact with Google Analytics APIs.

개요

GA-MCP (Google Analytics Management Control Panel) is a lightweight Node.js package that provides developers with a structured interface to interact with Google Analytics APIs. It simplifies common GA tasks like querying analytics reports, managing properties, audiences, and more—making it ideal for data analysts, developers, and marketing teams looking to automate reporting and analytics workflows. MCP standard. - Fetch and analyze GA performance data (sessions, users, pageviews, conversions) - Manage properties, data streams, and conversion events - Query custom dimensions and metrics - Access account hierarchies and property configurations - Export data for dashboards or further analysis - OAuth2 authentication with access and refresh tokens - Lightweight, secure, and highly configurable - get_reports: Get analytics reports data for specified metrics and dimensions - list_accounts: List all Google Analytics accounts - list_properties: List properties for a Google Analytics...

README

원문 README의 일부입니다. 원문 보기.

Google Analytics MCP Server

GA-MCP (Google Analytics Management Control Panel) is a lightweight Node.js package that provides developers with a structured interface to interact with Google Analytics APIs. It simplifies common GA tasks like querying analytics reports, managing properties, audiences, and more—making it ideal for data analysts, developers, and marketing teams looking to automate reporting and analytics workflows. MCP standard.

Features

  • Fetch and analyze GA performance data (sessions, users, pageviews, conversions)
  • Manage properties, data streams, and conversion events
  • Query custom dimensions and metrics
  • Access account hierarchies and property configurations
  • Export data for dashboards or further analysis
  • OAuth2 authentication with access and refresh tokens
  • Lightweight, secure, and highly configurable

MCP Tools

  • get_reports: Get analytics reports data for specified metrics and dimensions
  • list_accounts: List all Google Analytics accounts
  • list_properties: List properties for a Google Analytics account
  • list_data_streams: List data streams for a property
  • list_custom_dimensions: List custom dimensions for a property
  • list_custom_metrics: List custom metrics for a property
  • list_conversion_events: List conversion events for a property

Getting Started

Prerequisites

  • Node.js v18 or later
  • Google OAuth2 credentials (Client ID and Client Secret)
  • Valid Google Analytics access and refresh tokens

Authentication Setup

  1. Create OAuth2 Credentials:

    • Go to the Google Cloud Console

    • Create or select a project

    • Enable the Google Analytics API

    • Go to “Credentials” → “Create Credentials” → “OAuth 2.0 Client IDs”

    • Configure the consent screen and choose the appropriate application type:

      Option A: Web Application (Recommended)

      • Select “Web application”
      • Add http://localhost:3000/auth/callback to “Authorized redirect URIs”

      Option B: Desktop Application

      • Select “Desktop application”
      • No redirect URI configuration needed (uses out-of-band flow)
  2. Generate Access and Refresh Tokens:

    • Use the included helper script: npm run oauth-helper
    • Or use Google OAuth2 Playground with your client credentials
    • Or implement your own OAuth2 flow

Quick Setup Workflow

# 1. Set up environment file
npm run setup-env

# 2. Edit .env with your OAuth2 Client ID and Secret (from step 1 above)

# 3. Generate tokens
npm run oauth-helper

# 4. Copy the generated tokens to your .env file

# 5. Build and start
npm run build
node dist/index.js

Installation

Clone this repository and install dependencies:

pnpm install
# or
npm install

Build

pnpm build
# or
npm run build

Configuration Environment Variables

GitHub에서 전체 README 보기

설치

npx -y ga-mcp
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "ga-mcp": { "command": "npx", "args": ["-y", "ga-mcp"], "env": { "GOOGLE_CLIENT_ID": "your_oauth2_client_id", "GOOGLE_CLIENT_SECRET": "your_oauth2_client_secret", "GOOGLE_ACCESS_TOKEN": "your_access_token", "GOOGLE_REFRESH_TOKEN": "your_refresh_token" } } } }