ads-mcp
An MCP server that wraps the Google Ads and Meta Marketing APIs directly, letting an MCP client inspect and manage campaigns with spend-safe (paused-by-default) writes.
Google Ads — read: list campaigns with status/budget, and inspect a campaign's ad groups, keywords, ads, and negatives.
Google Ads — create: build a full Search campaign (ad groups, keywords, RSAs) that is always created PAUSED.
Google Ads — keywords: add keywords, pause/enable them (reversible), add campaign-level negatives, or permanently remove them with a required
confirm_delete: true.Google Ads — bid strategy: switch a campaign between MAXIMIZE_CLICKS (optional CPC ceiling) and MAXIMIZE_CONVERSIONS.
Google Ads — spend control: enable or pause a campaign via
google_ads_set_campaign_status, the only Google tool that can turn spend on.Meta — read: list campaigns, check an ad's review/rejection status, and list ads filtered by effective status (default DISAPPROVED).
Meta — spend control: enable or pause a campaign via
meta_ads_set_campaign_status, the only Meta tool in this schema that can turn spend on.Safety posture: read-only tools are annotated as such; destructive keyword removal is flagged destructive; all create paths land PAUSED.
Enables management of Google Ads Search campaigns, including listing campaigns, retrieving campaign structure, creating paused campaigns, managing keywords and negative keywords, updating bid strategies, and controlling campaign status.
Enables management of Meta ad campaigns and ads, including listing campaigns, retrieving ad review status and rejection reasons, listing ads by status (e.g., disapproved), and controlling campaign status.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ads-mcp list all disapproved Meta ads in the account"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ads-mcp
An MCP server wrapping the Google Ads API and Meta Marketing API directly, with no third-party quota or middleman. Point an MCP-compatible client at it and manage Search campaigns, keywords, ads, and the full Meta campaign lifecycle (create, publish, monitor, report) against Google's and Meta's own APIs.
Every write tool that could spend money is safe by default: google_ads_create_search_campaign and every Meta create/copy tool always create objects PAUSED. The only tools that can turn spend on are google_ads_set_campaign_status and meta_ads_set_campaign_status / meta_ads_set_ad_set_status / meta_ads_set_ad_status, called explicitly.
Setup
Credentials require logins and business identity only you have; nothing here can be automated. Do not commit .env.
Google Ads
Google Cloud project + OAuth client: console.cloud.google.com, new (or existing) project, APIs & Services, Credentials, Create OAuth client ID (type: Desktop app). Copy the Client ID/Secret into
.env.Under that OAuth client, add
http://localhost:8787/oauth2callbackas an authorized redirect URI.Developer token: ads.google.com/aw/apicenter, apply for a token. Basic access is free and usually approved within a few days; it allows ~15,000 operations/day. Put it in
.envasGOOGLE_ADS_DEVELOPER_TOKEN.Run
pnpm installthenpnpm google:auth. This opens a browser, you sign in and consent, and it prints a refresh token to paste into.envasGOOGLE_ADS_REFRESH_TOKEN.Set
GOOGLE_ADS_CUSTOMER_IDto the 10-digit account ID (no dashes) these tools should operate on by default. If that account is managed under an MCC account, also setGOOGLE_ADS_LOGIN_CUSTOMER_IDto the MCC's ID.
Meta Ads (System User token)
A personal user token dies when Facebook shows a login checkpoint (Graph error 190 / subcode 459). A Business Manager System User token is the supported way to keep Marketing API access independent of a person's browser session.
Meta App: developers.facebook.com, My Apps, Create App (type: Business). Copy the App ID and App Secret from Settings > Basic into
.envasMETA_APP_ID/META_APP_SECRET.Business Manager: open business.facebook.com > Business Settings.
Create a System User: Users > System Users > Add. Admin is simplest for ad account + Page + pixel assignment. Name it something like
ads-mcp.Assign assets to that System User (Add Assets):
Ad account: allow manage campaigns (or full control).
Facebook Page used in creatives: allow create content / manage ads (or full control).
Pixel used for optimization: allow advertise.
Generate a token: on the System User, Generate New Token. Select the app from step 1. Request at least:
ads_managementads_readbusiness_managementpages_show_listpages_read_engagementpages_manage_ads(needed to create unpublished Page posts / link creatives) Choose a never-expiring token if the UI offers it.
Put the token in
.envasMETA_ACCESS_TOKEN. Never commit it.Set
META_AD_ACCOUNT_IDto the numeric account ID (act_prefix optional). Optionally setMETA_PAGE_IDandMETA_PIXEL_IDso create tools do not need them on every call.Optional:
META_GRAPH_API_VERSIONpins the Graph version. Default isv26.0.
App Review / Development mode. If the app, ad account, Page and pixel all belong to the same Business, a System User token usually works while the app is in Development mode (Standard Access) without App Review. Advanced Access and App Review are required to manage other businesses' ad accounts, or when the app is Live and those permissions are restricted. ads_management and the pages_* permissions are the ones Meta most often holds behind review.
Housing, employment, credit, and (in some regions) financial products and services ads must set special_ad_categories accordingly (HOUSING, EMPLOYMENT, CREDIT, FINANCIAL_PRODUCTS_SERVICES). Those campaigns have extra targeting limits; Advantage+ may be required or forbidden depending on the category.
Call meta_ads_get_account first. If META_APP_ID and META_APP_SECRET are set, the response includes token debug (scopes, expiry).
Graph errors this server rewrites
Code | Typical cause | What to do |
| Token expired, revoked, or invalid | Generate a new System User token |
| User checkpoint | Complete the Facebook login checkpoint, then switch to a System User token |
| Missing permission or asset assignment | Assign the ad account / Page / pixel; add the scopes above; App Review if Live or cross-business |
| Invalid field or ads policy rejection | Fix the field or creative. Policy rejects cannot be overridden via the API |
| Rate limit | Wait and retry |
| Temporary policy block | Check Business Support Home and the account Quality tab |
Related MCP server: google-ads-mcp
Running
pnpm install
pnpm test
pnpm dev # MCP server over stdio via tsx
pnpm build && pnpm start # compiled versionOnce published to npm, it also runs via npx @gudlab/ads-mcp, no local clone needed. Point an MCP-compatible client at it, e.g. in Claude Code's .mcp.json:
{
"mcpServers": {
"ads-mcp": {
"command": "npx",
"args": ["-y", "@gudlab/ads-mcp"],
"env": {
"GOOGLE_ADS_CLIENT_ID": "...",
"GOOGLE_ADS_CLIENT_SECRET": "...",
"GOOGLE_ADS_DEVELOPER_TOKEN": "...",
"GOOGLE_ADS_REFRESH_TOKEN": "...",
"GOOGLE_ADS_CUSTOMER_ID": "...",
"META_APP_ID": "...",
"META_APP_SECRET": "...",
"META_ACCESS_TOKEN": "...",
"META_AD_ACCOUNT_ID": "...",
"META_PAGE_ID": "...",
"META_PIXEL_ID": "..."
}
}
}
}Before that's published, point it at the local build instead: command: "node", args: ["/path/to/ads-mcp/dist/index.js"], or command: "pnpm", args: ["dev"] with cwd set to this directory for local iteration.
First real run: verify before trusting it
The Google Ads and Meta Marketing APIs both shift field/enum names across versions, so before relying on any tool here for real campaign work:
Run
google_ads_list_campaigns/meta_ads_get_account/meta_ads_list_campaignsfirst, read-only, the cheapest way to confirm auth and the client libraries are wired correctly.Test
google_ads_create_search_campaignormeta_ads_create_campaignon a throwaway name, then check it in the ads UI rather than trusting the tool's own response as proof of correctness.Only after that, use
*_set_*_statuswithACTIVEon a real campaign.
End-to-end Meta example (always paused until the last step)
Budgets are in the ad account currency (e.g. 20 means 20 GBP, sent to Graph as 2000 minor units).
1. meta_ads_get_account
Confirm the token is valid and the account currency / timezone.
2. meta_ads_search_targeting
{ "q": "online shopping", "type": "interest" }
Copy an interest id from the results. Some detailed interests have been retired by Meta; try a broader query or type=behavior if this is empty.
3. meta_ads_estimate_audience
{ "targeting": { "countries": ["GB"], "age_min": 25, "age_max": 54, "interests": [{ "id": "6003139266461" }] },
"optimization_goal": "OFFSITE_CONVERSIONS" }
4. meta_ads_create_campaign
{ "name": "UK leads - paused",
"objective": "OUTCOME_LEADS",
"special_ad_categories": [] }
Returns campaign_id. Status is PAUSED.
5. meta_ads_create_ad_set
{ "campaign_id": "<campaign_id>",
"name": "GB 25-54 shopping",
"daily_budget": 15,
"optimization_goal": "OFFSITE_CONVERSIONS",
"billing_event": "IMPRESSIONS",
"custom_event_type": "COMPLETE_REGISTRATION",
"advantage_audience": false,
"targeting": {
"countries": ["GB"],
"age_min": 25,
"age_max": 54,
"interests": [{ "id": "6003139266461", "name": "Online shopping" }]
} }
Advantage+ audience is off (`targeting_automation.advantage_audience = 0`). Status is PAUSED.
6. meta_ads_upload_image
{ "url": "https://example.com/ads/hero.jpg" }
or { "path": "/absolute/path/hero.jpg" }
Returns hash.
7. meta_ads_create_ad_creative
{ "name": "Homepage v1",
"link": "https://example.com/?utm_source=meta",
"message": "Open an account from your banking app.",
"headline": "Pay from your bank",
"description": "No card needed.",
"image_hash": "<hash>",
"cta_type": "LEARN_MORE",
"url_tags": "utm_source=meta&utm_medium=paid&utm_campaign=uk_leads" }
8. meta_ads_create_ad
{ "name": "Ad 1", "ad_set_id": "<ad_set_id>", "creative_id": "<creative_id>" }
Status is PAUSED. Still no spend.
9. Activate spend, in this order (or campaign last):
meta_ads_set_ad_status { "ad_id": "<ad_id>", "status": "ACTIVE" }
meta_ads_set_ad_set_status { "ad_set_id": "<ad_set_id>", "status": "ACTIVE" }
meta_ads_set_campaign_status { "campaign_id": "<campaign_id>", "status": "ACTIVE" }
10. meta_ads_get_ad_status
Review / rejection lives in ad_review_feedback and issues_info.
11. meta_ads_get_insights
{ "level": "campaign", "object_id": "<campaign_id>", "date_preset": "last_7d" }
Optional: "breakdowns": ["age", "gender", "placement", "day"]
or "since": "2026-10-01", "until": "2026-10-07"Tool reference
Google Ads (src/google-ads/tools.ts): list_campaigns, get_campaign_structure, create_search_campaign (always PAUSED), add_keywords, set_keyword_status (pause/enable, reversible), remove_keywords (permanent, requires confirm_delete: true), update_bid_strategy, add_negative_keywords, set_campaign_status (the only enable/spend switch).
Meta Ads (src/meta-ads/tools.ts), all names prefixed meta_ads_:
Tool | Role |
| Ad account + optional token debug |
| Campaigns, nested ad sets and ads |
| Ad sets with targeting, budgets, Advantage+ flag |
| Ads, creatives, |
| Account / campaign / ad set / ad metrics, presets or custom dates, optional breakdowns |
| Keyword search for interests, behaviours, geo |
| Delivery / reach estimate |
| Objective, |
| Daily budget, optimization, pixel+event, manual targeting, Advantage+ off by default. Create is PAUSED |
| Local path or URL → image hash |
| Page, link, primary text, headline, description, CTA, |
| Attach a creative or replace copy. Create is PAUSED |
| Explicit |
| Duplicates, always PAUSED |
Privacy and data handling
All credentials stay in your own .env (never committed, see .gitignore) or your MCP client's own env config, and are used only to call Google's and Meta's APIs directly from your machine. This server sends nothing to any third party: no telemetry, no analytics, no relay service. Every request goes straight from your process to googleads.googleapis.com or graph.facebook.com, using your own developer token and access token.
License
MIT, see LICENSE.
Available Tools
13 toolsgoogle_ads_add_keywordsAdd keywords to a Google Ads ad groupC
Add keywords to an existing ad group
Inputs: keywords (required), ad_group_id (required), customer_id.
google_ads_add_negative_keywordsAdd Google Ads negative keywordsC
Add campaign-level negative keywords
Inputs: keywords (required), campaign_id (required), customer_id.
google_ads_create_search_campaignCreate Google Ads Search campaign (paused)B
Create a new Search campaign with ad groups, keywords and RSAs. Always created PAUSED.
Inputs: ad_groups (required), locations (required), daily_budget (required), campaign_name (required), +3 more.
google_ads_get_campaign_structureGet Google Ads campaign structureBRead-onlyIdempotent
Get a campaign's ad groups, keywords, ads, and negatives
Inputs: campaign_id (required), customer_id.
google_ads_list_campaignsList Google Ads campaignsBRead-onlyIdempotent
List campaigns with status and budget
Inputs: customer_id.
google_ads_remove_keywordsPermanently remove Google Ads keywordsBDestructiveIdempotent
Permanently remove keywords. Requires confirm_delete: true.
Inputs: ad_group_id (required), criterion_ids (required), confirm_delete (required), customer_id.
google_ads_set_campaign_statusEnable or pause a Google Ads campaignAIdempotent
Enable or pause a campaign. The only tool that can turn spend on.
Inputs: status (required), campaign_id (required), customer_id.
google_ads_set_keyword_statusPause or enable Google Ads keywordsBIdempotent
Pause or enable keywords (reversible)
Inputs: status (required), ad_group_id (required), criterion_ids (required), customer_id.
google_ads_update_bid_strategyUpdate Google Ads bid strategyCIdempotent
Change a campaign's bidding strategy
Inputs: strategy (required), campaign_id (required), customer_id, cpc_bid_ceiling.
meta_ads_get_ad_statusGet a Meta ad's review statusBRead-onlyIdempotent
Get an ad's review status and rejection reason if any
Inputs: ad_id (required).
meta_ads_list_ads_by_statusList Meta ads by review statusARead-onlyIdempotent
List ads in an account filtered by effective_status (e.g. DISAPPROVED)
Inputs: account_id, effective_status.
meta_ads_list_campaignsList Meta Ads campaignsBRead-onlyIdempotent
List Meta campaigns with status and budget
Inputs: account_id.
meta_ads_set_campaign_statusEnable or pause a Meta Ads campaignAIdempotent
Enable or pause a Meta campaign. The only tool that can turn spend on.
Inputs: status (required), campaign_id (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Every tool targets a distinct platform-resource-action combination, with clear google_ads_ vs meta_ads_ prefixes separating the two domains. Even the two set_campaign_status tools are disambiguated by the platform prefix and description.
Tool names consistently follow a {platform}_{verb}_{object} pattern in snake_case. Verbs like get, list, create, add, set, remove, update are applied uniformly, making the naming predictable across both platforms.
13 tools is a reasonable scope for an ads management server covering two platforms. The count is neither bloated nor thin, and each tool covers a distinct operation.
The Google Ads side is fairly complete with campaign creation, keyword management, bid strategy updates, and status controls. However, the Meta Ads side lacks any create or edit operations beyond status changes, making the surface significantly incomplete for managing Meta campaigns.
Maintenance
Related MCP Connectors
Google & Meta Ads management with 100+ tools. Audit, create, and optimize campaigns.
Run Meta, Google, TikTok, LinkedIn, Microsoft, Reddit, X and Pinterest ads from your AI agent.
Manage Google, Meta, TikTok, Microsoft, Pinterest, Amazon, LinkedIn & Reddit ads from your AI
Manage and optimize your ads on Meta, Google, TikTok, X, ChatGPT Ads, Reddit and LinkedIn from chat.
Related MCP Servers
AlicenseNot gradedqualityFmaintenanceConnects Google Ads, Meta Ads, and LinkedIn Ads to AI assistants, enabling natural language ad campaign management, reporting, and optimization across platforms.MIT- AlicenseBqualityCmaintenanceEnables full read/write control of Google Ads accounts—managing campaigns, ad groups, ads, keywords, Performance Max, budgets, targeting, and performance reporting through natural language. Supports Search, Display, Video, and Demand Gen campaign types with flexible GAQL querying and comprehensive reporting.471Apache 2.0
- FlicenseNot gradedqualityDmaintenanceEnables complete management of Google Ads, including CRUD operations, dashboards, reporting, and all features from the Google Ads panel.-
- AlicenseNot gradedqualityDmaintenanceEnables full Google Ads management through natural language, including reading campaigns, performance, ROAS, keywords, and search terms, as well as pausing, enabling, removing, and creating campaigns, ad groups, ads, keywords, budgets, and responsive search ads.MIT