Skip to content

Installation

John Williams edited this page Mar 6, 2026 · 1 revision

Installation

Install the package

# From PyPI (once published)
pip install googleadsagent-mcp

# From GitHub
pip install git+https://github.com/itallstartedwithaidea/google-ads-mcp.git

# With uv
uv add googleadsagent-mcp

# From source
git clone https://github.com/itallstartedwithaidea/google-ads-mcp.git
cd google-ads-mcp
pip install -e .

Requires Python 3.10+.

Configure your MCP client

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "google-ads": {
      "command": "python",
      "args": ["-m", "ads_mcp.server"],
      "env": {
        "GOOGLE_ADS_CREDENTIALS": "/path/to/google-ads.yaml",
        "GOOGLE_ADS_LOGIN_CUSTOMER_ID": "123-456-7890"
      }
    }
  }
}

Claude Code

Place .mcp.json in your project root (already included in the repo):

{
  "mcpServers": {
    "google-ads": {
      "type": "stdio",
      "command": "python",
      "args": ["-m", "ads_mcp.server"],
      "env": {
        "GOOGLE_ADS_CREDENTIALS": "${GOOGLE_ADS_CREDENTIALS}",
        "GOOGLE_ADS_LOGIN_CUSTOMER_ID": "${GOOGLE_ADS_LOGIN_CUSTOMER_ID}"
      }
    }
  }
}

Cursor / Windsurf

Settings → MCP → Add server:

  • Command: python -m ads_mcp.server

OpenAI Agents SDK

from agents.mcp import MCPServerStdio
import os

server = MCPServerStdio(
    command="python",
    args=["-m", "ads_mcp.server"],
    env={
        "GOOGLE_ADS_CREDENTIALS": os.environ["GOOGLE_ADS_CREDENTIALS"],
        "GOOGLE_ADS_LOGIN_CUSTOMER_ID": os.environ.get("GOOGLE_ADS_LOGIN_CUSTOMER_ID", ""),
    }
)

HTTP / Remote

python -m ads_mcp.server --http

Starts an SSE server on http://localhost:8000 for remote agent connections.

Environment variables

Copy .env.example to .env and fill in your credentials:

cp .env.example .env

See Connecting to Google Ads API for full credential setup.

Validate

python scripts/validate.py

This checks that your credentials are valid and the API is reachable.

Clone this wiki locally