Google Analytics MCP Server
Researchstdio
Google's official MCP server for Google Analytics 4. Lets AI agents run reports against the GA4 Data API, discover dimensions and metrics, and explore account and property metadata with server-side aggregation and safe defaults. Runs locally (via pipx) and connects to MCP-compatible clients for conversational analysis of website traffic and user behavior.
连接
将此配置添加到 .claude/mcp.json
{
"mcpServers": {
"google-analytics": {
"command": "npx",
"args": [],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "<YOUR_GOOGLE_APPLICATION_CREDENTIALS>"
}
}
}
}工具 (2)
run_report
Run a Google Analytics 4 report with the given metrics, dimensions, and date range.
{
"type": "object",
"required": [
"property_id",
"metrics"
],
"properties": {
"metrics": {
"type": "array",
"items": {
"type": "string"
},
"description": "Metrics to include (e.g. activeUsers, sessions)"
},
"date_range": {
"type": "object",
"description": "Start and end dates for the report"
},
"dimensions": {
"type": "array",
"items": {
"type": "string"
},
"description": "Dimensions to break down by (e.g. country, deviceCategory)"
},
"property_id": {
"type": "string",
"description": "GA4 property ID"
}
}
}get_property_details
Retrieve metadata and available dimensions/metrics for a GA4 property.
{
"type": "object",
"required": [
"property_id"
],
"properties": {
"property_id": {
"type": "string",
"description": "GA4 property ID"
}
}
}资源
此服务器未提供任何资源。
提示词
此服务器未提供任何提示词。
服务器信息
- 星标
- 0
- 最后更新
- 2026年7月12日