Purpose
Google Ad Manager MCP Server is an MCP (Model Context Protocol) server used to connect Google Ad Manager (GAM) to AI assistants. Its goal is to enable users to complete ad operations through natural language, rather than repeatedly clicking through GAM's complex interface.
Supported AI assistants include MCP-compatible clients such as Claude, ChatGPT, Gemini, Cursor, and VS Code. The project is built by Matious.
Main Capabilities
- Order management: list, create, and manage orders.
- Line item management: create, duplicate, and configure line items.
- Creative management: upload images, associate line items, batch upload.
- Advertiser management: find, create, and list advertisers.
- Validation tools: validate line item settings, check delivery status.
- Campaign workflows: complete full campaign creation in a single operation.
Example usage includes: "Create a new campaign for Nike ending December 31st", "Upload all creatives from this folder and associate them with the Display line item", "Check which orders are currently delivering".
Usage
Installation
Installing from PyPI is recommended. The tech stack includes FastMCP (an MCP server framework with native middleware support) and googleads (Google Ad Manager SOAP API client).
Configuration
The server uses environment variables for configuration.
Multi-network support
Multiple GAM networks can be managed in a single server instance. In GAM_NETWORK_CODES list all network codes, with the first as the default network: all tools accept an optional network_code parameter; when omitted, the first (default) network is used. All networks share the same service account credentials; just ensure the service account email has been added as a user to each network.
Running the Server
- Local development
- Docker deployment: the Docker image runs as a non-root user (appuser) for improved security. A docker-compose.yml file can be created.
- Cloud deployment (Railway, Fly.io, etc.): set the environment variables in the cloud provider
GAM_CREDENTIALS_PATH(credential path or use secrets),GAM_NETWORK_CODE(Ad Manager network code),GAM_MCP_AUTH_TOKEN(security authentication token), and deploy using the included Dockerfile.
Connecting to AI Assistants
- Claude Desktop (uvx recommended): add to
~/Library/Application Support/Claude/claude_desktop_config.json. - Claude Desktop (Docker): also add to the above configuration file.
- Claude Desktop (HTTP mode): used when the server runs in HTTP mode.
- Remote server with authentication: used when deployed remotely and authentication is enabled.
Other MCP clients: ChatGPT Desktop (OpenAI adopted MCP in March 2025), Cursor (an AI IDE that supports MCP), VS Code (via an MCP extension), Windsurf, Zed, Codeium, and other IDE integrations. For specific configuration, refer to each client's documentation.
MCP Inspector can be used for testing.
Security Features
The server uses FastMCP native middleware to implement Bearer token authentication, following MCP security best practices:
- FastMCP native middleware: use FastMCP 2.x middleware for correct MCP lifecycle management.
- Cryptographically secure tokens: generated using
secrets.token_hex(32). - Protection against timing attacks: use constant-time comparison (
hmac.compare_digest). - Tool-level authentication: authentication is verified on every tool call.
- Audit logging: log all authentication failures.
Authentication is enforced at the tool level through FastMCP's middleware system: when a tool is called, the middleware verifies the Authorization header; if no token is configured (GAM_MCP_AUTH_TOKEN Not set), the request is allowed; an invalid or missing token returns a ToolError with a hint message. For remote deployments, a fixed authentication token can be set; if not set, a random token is generated at startup and shown in the logs. The client must include this token in the Authorization header.
Use Cases
Suitable for teams and individuals who need to automate Google Ad Manager ad operations, especially ad operations scenarios where they want to create campaigns, upload creatives, configure line items, and check delivery status through a conversational AI assistant. Also suitable for businesses that need unified management across multiple GAM networks, or that need to connect GAM to custom AI workflows.
Limitations and Planning
- The server uses Google Ad Manager SOAP API version v202502.
- When the authentication token is not set, requests are allowed; remote deployments need to set a fixed token themselves.
- Multiple networks share the same service account credentials, and the service account needs to be added as a user in each network.
The following features are planned for future versions (not currently available): ad unit management (list, get, create ad units and hierarchy support), placement management, forecasting and availability, creative preview links, advanced targeting (geo, device, time slot, custom key-values), reporting tools (generate and retrieve performance reports), bulk operations (bulk updates of line items, creatives, targeting), HTML5/video creatives (rich media and video creative upload), audience management, users and permissions, revenue management (revenue groups and optimization configuration), custom reports (scheduled reports with export capability).
License and Contributions
The project uses the MIT license, see LICENSE for details. Contributions are welcome, please see CONTRIBUTING.md; version history is in CHANGELOG.md. Feature requests can be made by submitting an issue.
Other
This project is built and maintained by Matious, which focuses on building custom AI tools and MCP servers for businesses, and can integrate CRMs, ERPs, ad platforms, or internal tools. Contact address: matious.com.