Google Analytics Data API MCP Server
Google Analytics Data API MCP Server
Model Context Protocol(MCP) 서버를 사용하여 Google Analytics Data API에 액세스할 수 있는 인터페이스를 제공합니다.
기능
이 MCP 서버는 Google 웹로그 분석 데이터 API의 주요 기능에 액세스하기 위한 도구와 리소스를 제공합니다.
도구
get_report : 지정된 날짜 범위, 지표 및 차원을 기반으로 보고서를 가져옵니다.
get_realtime_data : 실시간 데이터를 가져옵니다.
자원
ga4://property/{propertyId}/metadata : Google 웹로그 분석 속성 메타데이터에 액세스
Related MCP server: Policy Analyzer API MCP Server
설정
전제 조건
Google Cloud 프로젝트를 만들고 웹로그 분석 데이터 API를 사용 설정합니다.
서비스 계정을 만들고 자격 증명 JSON 파일을 다운로드합니다.
서비스 계정에 GA4 속성에 대한 적절한 액세스 권한을 부여합니다.
자세한 설정 절차는 설정 가이드 를 참조하십시오.
설치
# リポジトリをクローン
git clone https://github.com/eno-graph/mcp-server-google-analytics.git
cd mcp-server-google-analytics
# 依存関係をインストール
npm install
# ビルド
npm run build환경 변수 설정
다음 환경 변수를 설정해야 합니다.
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"사용방법
서버 시작
npm start또는 제공된 스크립트를 사용할 수 있습니다.
./run-server.shClaude Desktop에서 설정
Claude Desktop 구성 파일에 다음을 추가합니다.
{
"mcpServers": {
"google-analytics": {
"command": "node",
"args": ["/path/to/mcp-server-google-analytics/build/index.js"],
"env": {
"GOOGLE_CLIENT_EMAIL": "your-service-account@project.iam.gserviceaccount.com",
"GOOGLE_PRIVATE_KEY": "your-private-key",
"GA_PROPERTY_ID": "your-ga4-property-id"
}
}
}
}자세한 구성 예는 claude-desktop-config-sample.json 을 참조하십시오.
도구 사용 예
보고서 얻기
get_report ツールを使用して、過去7日間のアクティブユーザー数とページビュー数を取得します。
引数:
{
"startDate": "7daysAgo",
"endDate": "today",
"metrics": ["activeUsers", "screenPageViews"],
"dimensions": ["date"],
"limit": 10
}실시간 데이터 획득
get_realtime_data ツールを使用して、現在アクティブなユーザー数を取得します。
引数:
{
"metrics": ["activeUsers"],
"dimensions": ["deviceCategory"],
"limit": 10
}리소스 사용 예
ga4://property/123456789/metadata リソースにアクセスして、利用可能なメトリクスとディメンションを確認します。사용 예
Claude에서 사용하는 예는 Claude 사용 예를 참조하십시오.
라이센스
MIT
Related MCP Connectors
Read-only Google Analytics 4 MCP server for AI assistants.
Hosted, read-only Google Analytics 4 MCP: reports, period comparisons, realtime, custom fields.
Read and edit GA4, Search Console and Google Tag Manager from any MCP client. 29 tools.
Hosted MCP server for GA4, Google Ads and Search Console. Google OAuth, nothing to install.
Related MCP Servers
- AlicenseBqualityFmaintenanceAn MCP server implementation for accessing Google Analytics 4 (GA4) data, built using the Model Context Protocol TypeScript SDK.5544 npm70MIT
- FlicenseNot gradedqualityDmaintenanceThis MCP Server provides a natural language interface to interact with Google's Policy Analyzer API, allowing users to analyze policies and evaluate compliance through conversations.-
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides unified access to Google Analytics 4 and Google Search Console data through real-time analytics queries.2MIT
- AlicenseNot gradedqualityDmaintenanceA FastMCP-powered Model Context Protocol server for Google Ads API integration with automatic OAuth 2.0 authentication Connect Google Ads API directly to MCP Clients with seamless OAuth 2.0 authentication, automatic token refresh, GAQL querying, and keyword research capabilities.145MIT