Skip to main content
Glama
ruchernchong

mcp-server-google-analytics

by ruchernchong

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

鍛冶屋のバッジ

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

特徴

  • カスタマイズ可能なディメンションでページビュー指標を取得

  • アクティブユーザーと新規ユーザーを時間の経過とともに追跡する

  • 特定のイベントとその指標を分析する

  • ユーザー行動指標(セッション継続時間、直帰率)を監視する

  • すべてのクエリに対して柔軟な日付範囲の選択

Related MCP server: MCP Search Analytics Server

前提条件

  • 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ファイルを参照してください。

A
license - permissive license
B
quality
F
maintenance

Maintenance

UpdatingMaintainers
UpdatingResponse time
Release cycle
0Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    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.
    1,209
    7
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    A Model Context Protocol server that provides unified access to Google Analytics 4 and Google Search Console data through real-time analytics queries.
    2
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    This project is a Google Analytics 4 (GA4) automation server implemented as a Model Context Protocol (MCP) tool. It lets AI agents query GA4 data (reports, traffic sources, demographics, etc.) and also includes a simple connection test script.
    7
    1
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A powerful Model Context Protocol (MCP) server that provides comprehensive Google Analytics 4 (GA4), Google Search Console (GSC), and Google Merchant Center (GMC) integration for Claude Desktop and other MCP clients.
    Apache 2.0

View all related MCP servers

Related MCP Connectors

  • MCP server for interacting with the Supabase platform

  • A Model Context Protocol server for Wix AI tools

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

View all MCP Connectors

Latest Blog Posts

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