Token导航 LogoToken导航TokenDH.com
Googleanalytics MCP Server logo
数据服务stdio官方级别未说明来源级核验

Googleanalytics MCP Server

MCP Server

一个用于查询Google Analytics数据、管理受众和访问元数据的MCP服务器。

工具数

11

提示词数

0

GitHub Stars

0

资源数

0
数据分析JavaScriptAPI集成

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

mattcoatsworth

提供方

mattcoatsworth

最后核验

2026/5/17 20:23

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

谷歌分析数据API MCP服务器

A Model Context Protocol (MCP) server for interacting with the Google Analytics Data API v1. This server provides tools and resources for querying Google Analytics data, managing audiences, and accessing metadata.

## Features

- Run standard and pivot reports
- Batch reporting capabilities
- Access metadata about dimensions and metrics
- Create, list, update, and delete audiences
- Check compatibility between dimensions and metrics
- Comprehensive resource endpoints for exploring GA data

## Prerequisites

- Node.js 14 or higher
- Google Analytics 4 property
- Google Cloud service account with appropriate permissions

## Setup

1. Clone this repository
2. Install dependencies:

npm install

3. Create a `.env` file based on `.env.example` with your Google Analytics credentials:

GOOGLE_CLIENT_EMAIL=your-service-account-email@project-id.iam.gserviceaccount.com GOOGLE_PRIVATE_KEY=your-private-key DEFAULT_PROPERTY_ID=properties/123456789


## Usage

### Running the Server

npm start


### Testing with MCP Inspector

npm run inspect


## Available Tools

- **runReport**: Run a standard report on Google Analytics data
- **batchRunReports**: Run multiple reports in a single batch
- **runPivotReport**: Run a pivot report on Google Analytics data
- **batchRunPivotReports**: Run multiple pivot reports in a batch
- **getMetadata**: Get metadata about dimensions and metrics
- **checkCompatibility**: Check compatibility between dimensions and metrics
- **createAudience**: Create a new audience
- **listAudiences**: List audiences in a property
- **getAudience**: Get details of a specific audience
- **deleteAudience**: Delete an audience
- **updateAudience**: Update an existing audience

## Available Resources

- **ga://property/{propertyId}**: Get property information
- **ga://report/{propertyId}/{reportType}/{dimensions}/{metrics}/{startDate}/{endDate}**: Generate reports
- **ga://metadata**: Get API metadata
- **ga://dimensions**: Browse dimensions by category
- **ga://dimensions/{category}**: Get dimensions in a specific category
- **ga://metrics**: Browse metrics by category
- **ga://metrics/{category}**: Get metrics in a specific category
- **ga://audiences/{propertyId}**: List audiences in a property
- **ga://audiences/{propertyId}/{audienceId}**: Get details of a specific audience

## Example Queries

### Running a Basic Report

{ "propertyId": "properties/123456789", "dateRanges": [ { "startDate": "7daysAgo", "endDate": "yesterday" } ], "dimensions": [ { "name": "country" }, { "name": "deviceCategory" } ], "metrics": [ { "name": "activeUsers" }, { "name": "sessions" } ] }


### Creating an Audience

{ "propertyId": "properties/123456789", "displayName": "High Value Users", "description": "Users who have completed a purchase", "membershipDurationDays": 30, "filterClauses": [ { "filterExpression": { "andGroup": { "expressions": [ { "filter": { "fieldName": "eventName", "stringFilter": { "value": "purchase", "matchType": "EXACT" } } } ] } } } ] }


## License

MIT

目录标签

目录标签

数据分析JavaScriptAPI集成本地部署GoogleAnalyticsAPI服务器数据查询受众管理

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

11

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP