GA4 Analytics MCP V3
GA4 Analytics MCP V3
True Model B コネクタ:1つのMCPオペレーターが複数の独立したGoogle OAuth接続を所有できます。各GA4クエリは、そのプロパティへのアクセス権を持つGoogle認証情報で実行されます。
これは新しいアプリケーションです。V2を変更せず、Firestore (default)(V1用に予約済み)も使用しません。
ローカル開発
cd D:\MCP_Servers\Ga4McpV3
npm install
copy .env.example .env.local
# Fill secrets. Set FIRESTORE_DATABASE_ID=ga4-mcp-v3 (never (default)).
npm test
npm run devアプリ:
http://localhost:3000MCP:
http://localhost:3000/mcpヘルスチェック:
http://localhost:3000/health
Related MCP server: GA4 MCP Server
Claude カスタムコネクタ
URL: https://<v3-host>/mcp
ClaudeがMCP OAuth 2.1を開始します(V2と同じフロー)。
最初のGoogleサインインが内部の
operatorIdをブートストラップします。その後、接続ページまたは
ga4_start_google_connectionから追加のGoogleアカウントを接続します。MCP JWTの
subは常にoperatorIdであり、Google OpenIDのsubではありません。
2つ目または3つ目のGoogleアカウントを接続する
Claudeからga4_start_google_connectionを呼び出し、返されたURLを開きます。または、認可中に接続ページの別のGoogleアカウントを接続を使用します。各認可は独立したOAuth IDです。
プロパティルーティング
property_id → this operator's ga4_properties row → connection_id → encrypted refresh token → GA4 APIサーバーは、現在のブラウザのGoogleログイン、Claudeのメール、またはプロパティ名を使用して認証情報を選択することはありません。
オペレーターの分離
オペレーターAは、connectionIdを推測してもオペレーターBの接続を読み込めません。所有権は、すべての機密操作でサーバー側でチェックされます。
Cloud Run
.\scripts\cloud-run-setup.ps1 -ProjectId YOUR_PROJECT_ID
.\scripts\cloud-run-deploy.ps1 -ProjectId YOUR_PROJECT_ID
.\scripts\cloud-run-set-env.ps1 `
-ProjectId YOUR_PROJECT_ID `
-AppBaseUrl https://YOUR_V3_CLOUD_RUN_URL `
-GoogleClientId ... -GoogleClientSecret ... `
-McpTokenSecret ... -OauthStateSecret ... -TokenEncryptionKey ...初回使用前に、名前付きFirestoreデータベースga4-mcp-v3を作成します。V1/V2とは別のGoogle OAuthウェブクライアントを使用します。
ドキュメント
This server cannot be deployed
Maintenance
Related MCP Connectors
OAuth MCP for Google, Meta, X, LinkedIn, Reddit, TikTok, GSC, GA4, WordPress and GHL.
Operate secure JoinLayer data pipelines through delegated OAuth.
Multiple Google accounts (Gmail, Calendar, Drive, Contacts, Tasks) in one Claude connector.
Multiple Google accounts (Gmail, Calendar, Drive, Contacts, Tasks) in one Claude connector.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Google Analytics APIs to fetch reports, manage properties, data streams, conversion events, and custom dimensions/metrics through OAuth2 authentication.67 npm6MIT
- FlicenseAqualityDmaintenanceEnables interaction with Google Analytics 4 to manage accounts, run standard or realtime reports, and validate event parameters. It supports dual authentication methods and integrates with GTM for end-to-end data collection orchestration.8-
- -licenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to securely manage Google Workspace services (Gmail, Calendar, Drive, Sheets, Contacts) with persistent multi-account OAuth. Uses OS keychain for credential storage with health monitoring and granular business rules for enterprise security.-
- FlicenseNot gradedqualityDmaintenanceEnables multi-user access to Google Workspace services (Gmail, Calendar, Docs, Sheets, Slides, Drive) via remote MCP with OAuth 2.1 authentication.-