GG

googleanalytics/google-analytics-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

3578 stars 751 forks 质量 79 趋势 56Apache-2.0

该仓库包含运行本地MCP服务器的源代码,该服务器与Google Analytics的API交互。

概览

该仓库包含运行本地MCP服务器的源代码,该服务器与Google Analytics的API交互。 欢迎加入讨论,并在🤖 Discord的-analytics-mcp频道提问。 服务器使用 Google Analytics 管理 API 和 Google Analytics 数据 API,提供多种用于大型语言模型的工具。 - get_account_summaries:检索用户的 Google Analytics 账户和属性信息。- get_property_details:返回有关某个资产的详细信息。- list_google_ads_links:返回指向某个资产的 Google Ads 账户链接列表。 - run_report:使用Data API运行Google Analytics报告。- run_funnel_report:使用Data API运行Google Analytics漏斗报告。- get_custom_dimensions_and_metrics:获取特定物业的自定义维度和指标。 - run_realtime_report:使用数据API运行Google Analytics实时报告。

概述(AI 翻译)

该仓库包含运行本地的源代码 与 API 交互的 MCP 服务器 谷歌分析。

欢迎加入讨论,在 🤖 -analytics-mcp 通道 在Discord上。

工具 🛠️

服务器使用 Google Analytics 管理 API 以及 谷歌分析数据API 以提供 用于大型语言模型的工具。

获取账户和财产信息 🟠

  • get_account_summaries:检索用户谷歌信息 分析账户和物业。
  • get_property_details:返回关于某一物业的详细信息。
  • list_google_ads_links:返回指向 Google Ads 账户的链接列表 一处房产。

运行核心报告 📙

  • run_report:使用数据API运行Google Analytics报告。
  • run_funnel_report:使用数据API运行Google Analytics漏斗报告。
  • get_custom_dimensions_and_metrics:检索自定义尺寸和 针对特定房产的指标。

运行实时报告 ⏳

  • run_realtime_report:运行 Google Analytics 实时报告,使用 数据API。

设置说明 🔧

✨ 观看Google Analytics MCP的设置 YouTube上的一步步教程 这些说明的详细说明。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Google Analytics MCP Server (Experimental)

This repo contains the source code for running a local MCP server that interacts with APIs for Google Analytics.

Join the discussion and ask questions in the 🤖-analytics-mcp channel on Discord.

Tools 🛠️

The server uses the Google Analytics Admin API and Google Analytics Data API to provide several Tools for use with LLMs.

Retrieve account and property information 🟠

  • get_account_summaries: Retrieves information about the user’s Google Analytics accounts and properties.
  • get_property_details: Returns details about a property.
  • list_google_ads_links: Returns a list of links to Google Ads accounts for a property.
  • list_property_annotations: Returns annotations for a property.
  • create_property_annotation: Creates an annotation for a property (requires passing the --allow-write flag and the analytics.edit scope).

Run core reports 📙

  • run_report: Runs a Google Analytics report using the Data API.
  • run_funnel_report: Runs a Google Analytics funnel report using the Data API.
  • get_custom_dimensions_and_metrics: Retrieves the custom dimensions and metrics for a specific property.

Run realtime reports ⏳

  • run_realtime_report: Runs a Google Analytics realtime report using the Data API.

Setup instructions 🔧

✨ Watch the Google Analytics MCP Setup Tutorial on YouTube for a step-by-step walkthrough of these instructions.

Setup involves the following steps:

  1. Configure Python.
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "analytics-mcp": { "command": "pipx", "args": ["run", "analytics-mcp"], "env": { "GOOGLE_APPLICATION_CREDENTIALS": "PATH_TO_CREDENTIALS_JSON", "GOOGLE_CLOUD_PROJECT": "YOUR_PROJECT_ID" } } } }