Skip to main content
Glama

mcp-server-google-analytics

by ruchernchong

Google アナリティクス MCP サーバー

Model Context Protocol TypeScript SDK を使用して構築された、Google アナリティクス 4 (GA4) データにアクセスするための MCP サーバー実装。

特徴

  • カスタマイズ可能なディメンションでページビュー指標を取得
  • アクティブユーザーと新規ユーザーを時間の経過とともに追跡する
  • 特定のイベントとその指標を分析する
  • ユーザー行動指標(セッション継続時間、直帰率)を監視する
  • すべてのクエリに対して柔軟な日付範囲の選択

前提条件

  • Node.js 20以上
  • Google アナリティクス 4 プロパティ
  • Analytics Data API が有効になっている Google Cloud プロジェクト
  • 適切な権限を持つサービス アカウントの資格情報

設定

  1. Google Cloud プロジェクトを作成し、Analytics Data API を有効にする
  2. サービスアカウントを作成し、認証情報JSONファイルをダウンロードします
  3. サービス アカウントに GA4 プロパティへの適切なアクセス権を付与します
  4. 環境変数を設定します。
export GOOGLE_CLIENT_EMAIL="your-service-account@project.iam.gserviceaccount.com" export GOOGLE_PRIVATE_KEY="your-private-key" export GA_PROPERTY_ID="your-ga4-property-id"

インストール

Smithery経由でインストール

Smithery経由で Claude Desktop 用の Google Analytics Server を自動的にインストールするには:

npx -y @smithery/cli install mcp-server-google-analytics --client claude

手動インストール

pnpm install mcp-server-google-analytics

使用法

サーバーの起動

pnpm start

Claude Desktopでの設定

Claude Desktop の構成にこれを追加します:

{ "mcpServers": { "google-analytics": { "command": "npx", "args": ["-y", "mcp-server-google-analytics"], "env": { "GOOGLE_CLIENT_EMAIL": "your-service-account@project.iam.gserviceaccount.com", "GOOGLE_PRIVATE_KEY": "your-private-key", "GA_PROPERTY_ID": "your-ga4-property-id" } } } }

利用可能な機能

ページビューを取得する

特定の日付範囲のページビュー指標を取得します。

{ "startDate": "2024-01-01", "endDate": "2024-01-31", "dimensions": ["page", "country"] // Optional }

アクティブユーザーを取得する

アクティブユーザーのメトリクスを取得します。

{ "startDate": "2024-01-01", "endDate": "2024-01-31" }

取得イベント

イベント メトリックを取得します。

{ "startDate": "2024-01-01", "endDate": "2024-01-31", "eventName": "purchase" // Optional }

getUserBehavior

ユーザー行動のメトリクスを取得します。

{ "startDate": "2024-01-01", "endDate": "2024-01-31" }

セキュリティに関する考慮事項

  • 機密性の高い認証情報には常に環境変数を使用する
  • 適切なCORS設定を実装する
  • サービス アカウントの権限を設定するときは、最小権限の原則に従ってください。
  • サービスアカウントの認証情報を定期的にローテーションする
  • APIの使用状況を監視し、必要に応じてレート制限を実装する

貢献

貢献を歓迎します!行動規範とプルリクエストの送信手順の詳細については、貢献ガイドをお読みください。

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細についてはLICENSEファイルを参照してください。

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Model Context Protocol TypeScript SDK を使用して構築された、Google アナリティクス 4 (GA4) データにアクセスするための MCP サーバー実装。

  1. 特徴
    1. 前提条件
      1. 設定
        1. インストール
          1. Smithery経由でインストール
          2. 手動インストール
        2. 使用法
          1. サーバーの起動
          2. Claude Desktopでの設定
        3. 利用可能な機能
          1. ページビューを取得する
          2. アクティブユーザーを取得する
          3. 取得イベント
          4. getUserBehavior
        4. セキュリティに関する考慮事項
          1. 貢献
            1. ライセンス

              Related MCP Servers

              • A
                security
                F
                license
                A
                quality
                An MCP (Model Context Protocol) server that provides Google search capabilities and webpage content analysis tools. This server enables AI models to perform Google searches and analyze webpage content programmatically.
                Last updated -
                3
                27
                80
                TypeScript
              • -
                security
                F
                license
                -
                quality
                Provides an interface to access Google Analytics Data API through Model Context Protocol (MCP), allowing users to retrieve reports and realtime data from Google Analytics 4 properties.
                Last updated -
                0
                7
                JavaScript
              • -
                security
                F
                license
                -
                quality
                An MCP (Multi-Agent Conversation Protocol) Server providing natural language access to Google's Cloud Datastore services through the v1beta1 API.
                Last updated -
                Python
              • -
                security
                F
                license
                -
                quality
                Connects Google Analytics 4 data to Claude, Cursor and other MCP clients, enabling natural language queries of website traffic, user behavior, and analytics data with access to 200+ GA4 dimensions and metrics.
                Last updated -
                95
                Python

              View all related MCP servers

              MCP directory API

              We provide all the information about MCP servers via our MCP API.

              curl -X GET 'https://glama.ai/api/mcp/v1/servers/ruchernchong/mcp-server-google-analytics'

              If you have feedback or need assistance with the MCP directory API, please join our Discord server