GO

Google Ads MCP Server for Programmatic Facebook Ads

Enable programmatic Facebook Ads management with an MCP server interfacing Google Ads for automated data access and campaign control.

Quick Install
npx -y @gomarble-ai/google-ads-mcp-server

Overview

This MCP (Model Context Protocol) server exposes Google Ads account data and campaign controls as tools that can be invoked programmatically by model-driven workflows to manage Facebook Ads. In practice it acts as a bridge: the server ingests Google Ads signals (audiences, performance metrics, budgets) and exposes a consistent, authenticated API surface compatible with MCP-enabled agents so models can read data and invoke actions to control programmatic Facebook Ads activity.

The server is useful when you want to automate cross-platform advertising workflows, for example using historical Google Ads performance to seed audience creation, pacing logic, or creative selection on Facebook. By wrapping credentials, rate-limits, auditing, and data transformations behind tool endpoints, it lets models and orchestration systems safely access advertising primitives without embedding service credentials inside prompts or application logic.

Features

  • Exposes Google Ads data as MCP-compatible tools for model-driven agents
  • Auth flow and credential management for Google Ads and Facebook APIs
  • Tool endpoints for campaign creation, budget updates, audience syncs, and reporting
  • Rate limiting, retry logic, and basic error normalization
  • Logging and audit trails for tool invocations
  • Local development via Docker and environment-driven configuration
  • Webhook and polling options for near-real-time sync between platforms

Installation / Configuration

Clone the repository and install dependencies (Node.js example):

git clone https://github.com/gomarble-ai/google-ads-mcp-server.git
cd google-ads-mcp-server
npm install

Environment configuration (example .env):

# Google Ads
GOOGLE_ADS_CLIENT_ID=your-google-client-id
GOOGLE_ADS_CLIENT_SECRET=your-google-client-secret
GOOGLE_ADS_DEVELOPER_TOKEN=your-developer-token
GOOGLE_ADS_REFRESH_TOKEN=your-refresh-token

# Facebook / Meta
FACEBOOK_ACCESS_TOKEN=your-facebook-access-token
FACEBOOK_AD_ACCOUNT_ID=act_123456789

# Server
MCP_SERVER_PORT=8080
LOG_LEVEL=info
RATE_LIMIT_PER_MINUTE=60

Start the server locally:

npm run build   # if using TypeScript
npm start

Or run with Docker:

# docker-compose.yml
version: "3.8"
services:
  mcp-server:
    image: gomarble/google-ads-mcp-server:latest
    ports:
      - "8080:8080"
    environment:
      - GOOGLE_ADS_CLIENT_ID=${GOOGLE_ADS_CLIENT_ID}
      - GOOGLE_ADS_CLIENT_SECRET=${GOOGLE_ADS_CLIENT_SECRET}
      - FACEBOOK_ACCESS_TOKEN=${FACEBOOK_ACCESS_TOKEN}
docker-compose up

Available Tools / Resources

The server exposes a set of tools (HTTP endpoints) that an MCP client or model can invoke. Typical tools include:

Tool nameMethodPathDescription
get_campaignsGET/tools/get_campaignsList Google Ads campaigns and metrics
sync_audiencePOST/tools/sync_audienceConvert a Google Ads audience to Facebook Custom Audience
create_fb_campaignPOST/tools/create_fb_campaignCreate or update a Facebook campaign from a spec
update_budgetPOST/tools/update_budgetAdjust budget pacing on Facebook based on rules
get_reportPOST/tools/get_reportFetch aggregated performance metrics and anomalies
simulatePOST/tools/simulateRun a dry-run of actions and return expected outcomes

Example: request a campaign creation tool via curl

curl -X POST http://localhost:8080/tools/create_fb_campaign \
  -H "Content-Type: application/json" \
  -d '{
    "source_campaign_id":"123456",
    "name":"Lookalike_Campaign_From_GA",
    "budget":{"amount":500,"currency":"USD"},
    "targeting":{"countries":["US"],"audience_source":"google_audience_42"},
    "dry_run":false
  }'

Responses follow a normalized schema with status, request id, and standardized error codes to make them easy for models to consume.

Use Cases

  • Audience Syncing: Export a high-performing Google Ads remarketing list and create a matching Facebook Custom Audience to target with similar creatives. Example: schedule a nightly sync of “last 30-day converters” into Facebook using /tools/sync_audience.
  • Budget Rebalancing: Use Google Ads pacing signals (e.g., CPA spikes) to reduce spend on Facebook campaigns that are likely to underperform. Example: model reads /tools/get_report then calls /tools/update_budget to shift daily caps.
  • Cross-Platform A/B Testing: Generate variants from Google Ads top-performing creatives and programmatically create corresponding Facebook ad sets using /tools/create_fb_campaign, then fetch results via /tools/get_report for comparative analysis.
  • Automated Alerts & Remediation: Detect anomaly in CPC/CTR via /tools/get_report and trigger /tools/simulate to preview corrective actions, then apply them if simulated outcome meets thresholds.

Notes and Best Practices

  • Always run in dry-run mode when testing tool invocations to prevent accidental spend.
  • Store sensitive credentials in a secure secrets manager; the server accepts environment variables but can be configured to use vaults.
  • Respect ad platform policies and rate limits; the server includes basic throttling but you should tune it for production workloads.
  • Review audit logs before enabling autonomous model-driven actions in production.

For more details, sample workflows, and advanced configuration options, see the repository at https://github.com/gomarble-ai/google-ads-mcp-server.