How cohnen/mcp-google-ads works
Project Type and Purpose
• This is a Python-based microservice (“Google Ads MCP Server”) that exposes a set of “tools” (list_accounts, execute_gaql_query, etc.) to AI-driven clients (Claude AI assistant and Cursor AI code editor).
• Its sole purpose is to connect to the Google Ads API, fetch advertising data, and present it in natural-language or structured form to the AI clients.
File Structure Analysis
• Top-level code artifacts:
• google_ads_server.py – the entrypoint for the MCP server
• format_customer_id_test.py, test_google_ads_mcp.py, test_token_refresh.py – unit tests for core functionality and authentication
• requirements.txt / pyproject.toml – Python dependencies (e.g., google-ads, mcp)
• Configuration & docs:
• .env.example – environment variable template
• .cursor/ – Cursor AI editor integration rules
• docs/ – markdown documentation for each tool
• No frontend code; all logic lives in the MCP server and supporting test/config files.
README Insights
• Describes two auth methods (OAuth2, Service Account) and environment/configuration flows.
Detailed Steps for Drafting
1. Sketch Users at the left, AI Clients next, MCP Server in the center, Google Ads API at the right.
a. FastMCP Core
b. Tools Layer (with bullet list of tool names)
c. Auth Module ← Credentials (OAuth2 JSON / Service account JSON)
– User → Claude / Cursor (“chat & tool requests”)
– Claude / Cursor → MCP Server (“invoke <tool>”)
– MCP Server → Google Ads API (“REST/gRPC call with credentials”)
– Google Ads API → MCP Server (“AdData JSON”)
– MCP Server → Claude / Cursor (“formatted results”)