Google Ads MCP Server

Google Ads MCP Server

Enables LLMs to interact with the Google Ads API through the Model Context Protocol, allowing natural language queries for campaign management and metrics.

Category
访问服务器

README

Google Ads MCP Server

The Google Ads MCP Server is an implementation of the Model Context Protocol (MCP) that enables Large Language Models (LLMs), such as Gemini, to interact directly with the Google Ads API.

This is not an officially supported Google product.

Disclaimer

Copyright Google LLC. Supported by Google LLC and/or its affiliate(s). This solution, including any related sample code or data, is made available on an “as is,” “as available,” and “with all faults” basis, solely for illustrative purposes, and without warranty or representation of any kind. This solution is experimental, unsupported and provided solely for your convenience. Your use of it is subject to your agreements with Google, as applicable, and may constitute a beta feature as defined under those agreements. To the extent that you make any data available to Google in connection with your use of the solution, you represent and warrant that you have all necessary and appropriate rights, consents and permissions to permit Google to use and process that data. By using any portion of this solution, you acknowledge, assume and accept all risks, known and unknown, associated with its usage and any processing of data by Google, including with respect to your deployment of any portion of this solution in your systems, or usage in connection with your business, if at all. With respect to the entrustment of personal information to Google, you will verify that the established system is sufficient by checking Google's privacy policy and other public information, and you agree that no further information will be provided by Google.

Getting Started

Follow these instructions to configure and run the Google Ads MCP Server.

1. Configure Python Environment

For Direct Use

This project needs Python 3.12 with pipx or uv.

For Development

This project uses uv for dependency management.

Install uv and then run the following command to install the required Python packages:

uv pip sync

2. Configure Google Ads credentials

This tool requires you to have a google-ads.yaml file with your Google Ads API credentials. By default, the application will look for this file in your home directory.

If you don't have one, you can generate it by running the following example from the google-ads-python library: authentication example

Make sure your google-ads.yaml file contains the following keys:

  • client_id
  • client_secret
  • refresh_token
  • developer_token
  • login_customer_id (optional, but recommended)

3. Launch MCP Server

For Direct Use with Gemini CLI

Update your Gemini configuration to include the google-ads-mcp server. The following is an example of a local MCP server configuration:

{
  // Other configs...
  mcpServers: {
    GoogleAds: {
      command: "pipx",
      args: [
        "run",
        "--spec",
        "git+https://github.com/google-marketing-solutions/google_ads_mcp.git",
        "run-mcp-server",
      ],
      env: {
        GOOGLE_ADS_CREDENTIALS: "PATH_TO_YAML",
      },
      timeout: 30000,
      trust: false,
    },
  },
}

Once the server is running, you can interact with it using the Gemini CLI. Type /mcp in Gemini to see the Google Ads API server listed in the results.

For Local Development with Gemini CLI

Update your Gemini configuration to include the google-ads-mcp server. [DIRECTORY] will be the absolute path to the project. The following is an example of a local MCP server configuration:

{
  // Other configs...
  mcpServers: {
    GoogleAds: {
      command: "uv",
      args: ["run", "--directory", "[DIRECTORY]", "-m", "ads_mcp.server"],
      cwd: "[DIRECTORY]",
      timeout: 30000,
      trust: false,
    },
  },
}

Once the server is running, you can interact with it using the Gemini CLI. Type /mcp in Gemini to see the Google Ads API server listed in the results.

You can then ask questions like:

  • "list all campaigns"
  • "show me metrics for campaign [CAMPAIGN_ID]"
  • "get all ad groups"

Direct Launch

To start the server directly, in the project path, run the following command:

uv run -m ads_mcp.server

The server will start and be ready to accept requests.

Fork Notes (Contractor Scale)

This repository is a fork of the original google-ads-mcp project. It keeps the same core functionality while adding a few deployment- and client-specific enhancements for use at Contractor Scale and for integration with TypingMind and other MCP clients.

Additional Features in This Fork

  • SSE transport as default The server now defaults to the sse transport, configurable via the MCP_TRANSPORT environment variable. This is intended to work well with MCP clients that expect an SSE endpoint, including TypingMind.

  • Custom /sse POST handler for MCP clients A custom POST route is added at /sse to improve compatibility with MCP clients that send POST requests (rather than GET) when establishing an SSE connection. The handler:

    • Accepts JSON-RPC initialize requests
    • Returns the initialize response as an SSE event: message with the JSON-RPC payload
    • Falls back to returning an endpoint URL for non-initialize requests
  • CORS and preflight support The /sse endpoint includes CORS headers and an OPTIONS handler so that browser-based MCP clients (such as TypingMind) can connect from a different origin.

  • Render-friendly deployment This fork adds:

    • render.yaml – example Render web service configuration
    • requirements.txt – dependency list for platforms that expect it
    • RENDER_DEPLOYMENT.md – step‑by‑step deployment guide
    • CHANGELOG.md – records of fork-specific changes and how to revert them
  • Cloud credentials from environment variables In addition to reading google-ads.yaml from disk, the server can now create that file at startup from a GOOGLE_ADS_YAML environment variable, which is convenient for cloud providers that store secrets as env vars.

  • Non-blocking initialization Google Ads credential checks and view generation now run in a background thread so the server can bind to its port quickly on platforms like Render that actively scan for open ports during deploys.

These changes are maintained with the goal of staying close to the upstream project so that future updates can be merged more easily.

Contributing

We welcome contributions! Please see our CONTRIBUTING.md guide for details.

License

Google Ads MCP Server is an open-source project licensed under the APACHE-2.0 License.

Contact

If you have any questions, suggestions, or feedback, please feel free to open an issue.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选