Skip to main content
Glama
devopsbrandmirchi

GA4 Analytics MCP V3

GA4 Analytics MCP V3

True Model B 커넥터: 하나의 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:3000

  • MCP: http://localhost:3000/mcp

  • 상태 확인: http://localhost:3000/health

Related MCP server: GA4 MCP Server

Claude 커스텀 커넥터

URL: https://<v3-host>/mcp

  1. Claude가 MCP OAuth 2.1을 시작합니다(동일한 V2 흐름).

  2. 첫 번째 Google 로그인이 내부 operatorId를 부트스트랩합니다.

  3. 그 후 연결 페이지 또는 ga4_start_google_connection에서 추가 Google 계정을 연결합니다.

  4. MCP JWT sub는 항상 operatorId이며, Google OpenID sub가 아닙니다.

두 번째 또는 세 번째 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 웹 클라이언트를 사용하세요.

문서

Related MCP Connectors

Related MCP Servers

  • F
    license
    A
    quality
    D
    maintenance
    Enables 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
    -
  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables 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.
    -