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.
npx -y @gomarble-ai/google-ads-mcp-serverOverview
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):
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:
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}
Available Tools / Resources
The server exposes a set of tools (HTTP endpoints) that an MCP client or model can invoke. Typical tools include:
| Tool name | Method | Path | Description |
|---|---|---|---|
| get_campaigns | GET | /tools/get_campaigns | List Google Ads campaigns and metrics |
| sync_audience | POST | /tools/sync_audience | Convert a Google Ads audience to Facebook Custom Audience |
| create_fb_campaign | POST | /tools/create_fb_campaign | Create or update a Facebook campaign from a spec |
| update_budget | POST | /tools/update_budget | Adjust budget pacing on Facebook based on rules |
| get_report | POST | /tools/get_report | Fetch aggregated performance metrics and anomalies |
| simulate | POST | /tools/simulate | Run a dry-run of actions and return expected outcomes |
Example: request a campaign creation tool via curl
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.