
该仓库包含运行MCP服务器的源代码,该服务器与Google Ads API交互。
概览
该仓库包含运行MCP服务器的源代码,该服务器与Google Ads API交互。 该服务器使用 Google Ads API 提供多种工具和资源,用于大型语言模型(LLM)和 AI 代理。 - 搜索:检索有关 Google Ads 账户的信息。- get_resource_metadata:检索 Google Ads API 资源类型的元数据,例如“campaign”。这有助于理解数据结构及可查询的字段。- list_accessible_customers:返回用户通过认证呼叫直接访问的客户 ID。 Google Ads MCP 服务器使用 tools_config.yaml 功能,允许您有选择地启用或禁用单个工具或工具类别(命名空间),并自定义其命名空间前缀。 包里捆绑了一个默认的 tools_config.yaml,启用了所有工具,所以服务器开箱即用,无需额外设置。
概述(AI 翻译)
该仓库包含运行 与 谷歌广告API。
工具
服务器使用 Google Ads API 以提供 用于大型语言模型和人工智能代理的工具和资源。
可用工具
search:检索有关谷歌广告账户的信息。get_resource_metadata:检索关于 Google Ads API 资源类型的元数据,例如“campaign”。这有助于理解数据结构及可查询的字段。list_accessible_customers:直接访问客户的退货ID。 由用户认证通话。
配置与命名空间工具
Google Ads MCP 服务器使用 tools_config.yaml 来选择性地启用或禁用各个工具或工具类别(命名空间),并自定义它们的命名空间前缀。
默认的 tools_config.yaml 功能启用所有工具,随包捆绑,因此服务器开箱即用,无需额外设置。为了自定义安装,服务器按以下顺序解析配置:
- 通过环境变量
GOOGLE_ADS_MCP_TOOLS_CONFIG设置的显式路径。 - 一个’tools_config。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Google Ads MCP Server
This repo contains the source code for running an MCP server that interacts with the Google Ads API.
Tools
The server uses the Google Ads API to provide several Tools and Resources for use with LLMs and AI agents.
Tools available
search: Retrieves information about the Google Ads account.get_resource_metadata: Retrieves metadata about a Google Ads API resource type, for example “campaign”. This is useful to understand the structure of the data and what fields are available for querying.list_accessible_customers: Returns ids of customers directly accessible by the user authenticating the call.
Configuring and Namespacing Tools
The Google Ads MCP server uses the tools_config.yaml to let you selectively enable or disable individual tools or tool categories (namespaces) and customize their namespace prefixes.
A default tools_config.yaml with all tools enabled is bundled with the package, so the server works out of the box with no extra setup. To customize your installation, the server resolves the configuration in the following order:
- An explicit path set via the
GOOGLE_ADS_MCP_TOOLS_CONFIGenvironment variable. - A
tools_config.yamlfile in the current working directory. - The default
tools_config.yamlbundled with the package.
If an explicitly requested configuration file (via the environment variable) is missing, or any resolved file is invalid, the server raises an error and fails to start.
Configuration Example:
namespaces:
# Option 1: Enable category 'customers' with default prefix -> "customers_list_accessible_customers"
customers: true
# Option 2: Enable category 'search' with a custom prefix -> "query_search"
search: "query"
# Option 3: Fine-grained control over tools in a category
metadata:
enabled: true
prefix: "metadata"
enabled_tools:
- get_resource_metadata: true
Resources available
discovery-document: Retrieve the Google Ads API discovery document. Provides the discovery document for the latest version of the Google Ads API, which describes the API surface, including resources, methods, and schemas. Host LLMs should access this resource to understand the structure of the Google Ads API and discover available features.metrics: Retrieve information about the metrics available for reporting in the Google Ads API.segments: Retrieve information about the segments available for reporting in the Google Ads API.release-notes: Retrieve the release notes for the latest version of the Google Ads API.
Notes
- The MCP Server will expose your data to the Agent or LLM that you connect to it.
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"google-ads-mcp": {
"serverUrl": "http://localhost:8080/mcp"
}
}
}