/meta-ads:meta-adsfrom meta-ads
Manage Meta (Facebook/Instagram) advertising — campaigns, ad sets, ads, creatives, performance insights, product catalogs and feeds, datasets (pixels), A/B and lift studies — via Meta's own two AI connectors: the hosted ads MCP server at mcp.facebook.com/ads and the ads-cli (`meta`, PyPI `meta-ads`). Use when the user asks about Meta/Facebook/Instagram ad spend, ROAS, CPC/CPM/CTR, a campaign or ad set, creating or pausing an ad, budget changes, a product catalog or feed, pixel/signal health, or mentions Ads Manager, Marketing API, ads-cli, or the Meta ads MCP. Do NOT use for Google Analytics (see ga4), Google Tag Manager (see gtm), or Search Console (see gsc) — those measure the site traffic Meta ads send, not the ads themselves.
Ships in meta-ads. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Two paths onto the same Marketing API, with different auth and different reach. Pick per task, not per session.
https://mcp.facebook.com/ads, run by Meta, declared as a real MCP server at the plugin root (plugins/meta-ads/.mcp.json, one level up from this file). Browser OAuth, no Meta app and no token to manage. Its tools are simply in your tool list once the plugin is enabled and a session has started after that — 98 of them, counted live, against the 29 that published write-ups claim, so read your own tool list rather than any number. Several whole features exist only here: custom audiences and pixel event/parameter configuration have no CLI command at all, experiments are read-only in the CLI but writable here, and ad preview, delivery-error lookup, field/alias resolution, Ads Library competitor search, activity logs, benchmarks and opportunity score are all MCP-only.meta, run locally via scripts/meta_ads.py. A Meta system user access token. 72 commands with the full flag surface of the Marketing API: DCO creatives with multiple images/titles/bodies, raw --targeting / --promoted-object / --asset-feed-spec JSON, EU DSA payor/beneficiary fields, --fields as an escape hatch to any API field. Scriptable, so it is the path for anything batched or repeated.Default to the MCP tools for reading and for ordinary campaign work. Reach for the CLI when the MCP server has no tool for it, when a flag the tools don't expose matters, or when the same operation runs across many entities.
meta directly — go through scripts/meta_ads.pypython3 scripts/meta_ads.py check --account act_123456
python3 scripts/meta_ads.py --account act_123456 ads campaign list
python3 scripts/meta_ads.py --account act_123456 --dry-run ads campaign create --name "Q4 Sales" --objective OUTCOME_SALES --daily-budget 5000
The wrapper exists because the bare CLI has four traps, each verified live against v1.1.0:
meta auth status lies. It prints Authenticated (token: ****) and exits 0 for any non-empty string — it checks presence, never validity. meta_ads.py check calls the live API instead and exits non-zero when the token is rejected, and again when the token is valid but cannot reach the --account you named..env anywhere up the directory tree is read automatically, including from a subdirectory of the repo that holds it. ACCESS_TOKEN there wins over nothing at all, so running the CLI from the wrong directory can silently spend from the wrong account. The wrapper always sets the child's ACCESS_TOKEN/AD_ACCOUNT_ID/BUSINESS_ID explicitly — a real environment variable beats .env, and an empty one still beats it — and prints which file it ignored.ACCESS_TOKEN is far too generic a name to export globally. The wrapper reads META_ADS_ACCESS_TOKEN and remaps it for the subprocess only, the same reasoning as ga4's GA_SERVICE_ACCOUNT_KEY.meta auth status with nothing configured prints Not authenticated and still exits 0.--account act_... is required on every command except ads adaccount and ads page, which are system-user-scoped. --account/--business are the wrapper's own flags, routed to the child environment; pass the CLI's --ad-account-id only where it is a genuine leaf option (ads dataset connect|disconnect). --dry-run prints the resolved command and whether it counts as a write, without running it.
Full command map, budget modes, exit codes, and the rest of the traps: reference/cli.md. Tool inventory, call contracts, account-gating flags, and verified OAuth metadata: reference/mcp.md.
client_conversation_id — required on every call. Generate one 20-character A-Za-z0-9 string on your first Meta Ads call and reuse that same value for every Meta Ads call in the conversation, topic changes included. Never derive it from an account/business/campaign id, and never send it to another MCP server's tools.
advertiser_request — the user's own words, quoted, not paraphrased. Keep their language (do not translate), their register, and their vocabulary; don't upgrade plain words into ad-industry terms or add field names they never said. When they set a goal early and only said "yes" later, capture the goal, not the "yes". No names, contact details, or other personal data — this field goes to Meta.
META_ADS_ACCESS_TOKEN exported, holding a Meta system user access token with business_management, ads_management, pages_show_list, pages_read_engagement, pages_manage_ads, catalog_management, read_insights. On zsh put it in ~/.zshenv, not ~/.zshrc — .zshrc is interactive-shell-only and invisible to the non-interactive shell an agent runs commands in.--account is required on every call for exactly that reason.uv installed — the wrapper runs uvx --from meta-ads meta when meta is not on PATH, which uv caches after the first launch. pip install meta-ads also works, as does META_ADS_CLI pointing at any command. Python 3.12+ either way./mcp shows the connection state. It uses authorization-code OAuth with PKCE against https://www.facebook.com/v26.0/dialog/oauth and registers its own client dynamically, so there is no app to create and no client ID to configure.Click-by-click system user creation, token generation, and what each scope buys: reference/setup.md.
1. Resolve the ad account first, don't ask for it. ads adaccount list (CLI) or ads_get_ad_accounts (MCP) names every account the identity can reach. The two paths do not see the same set — a system user token reaches only what its business owns, while MCP OAuth reaches everything the person can, personal accounts included. So the account you must name is not implied by either.
Read the currency before quoting any money, and never trust a field name for the unit. Budgets are bare integers in the account currency's smallest unit; the CLI help says "cents" and MCP's field is literally called min_daily_budget_cents, and both are wrong for a currency with no subunit. Verified live: an IDR account reports min_daily_budget_cents: 18014, meaning Rp 18,014; a USD account reports 100, meaning $1.00. So the same --daily-budget 5000 is $50.00 on one and Rp 5,000 on the other. min_daily_budget_cents from ads_get_ad_accounts is the cheapest anchor for what an integer means on a given account — read it before writing a budget, and quote money back to the user in that account's currency.
2. Read before you write, every time. campaign list → adset list → ad list, or the MCP insights tools. Never guess an ID; copy it from a list response. An ad references a creative that must already exist, and an ad set references a campaign — the tree only makes sense top-down.
3. Keep the budget in exactly one place. CBO puts it on the campaign, ABO on the ad sets, flex (--adset-budget-sharing) on the ad sets with up to 20% shared. Setting it in both places is the single most common failure, and the bid strategy and pacing flags move level with the budget. reference/cli.md has the decision table.
4. Create PAUSED and leave it that way. The CLI defaults every create to --status PAUSED, verified in its own --help. The MCP side ships ads_activate_entity as a tool distinct from every create tool, which is what a create-paused design looks like — but no create has been run here, so check the status on the entity the tool returns the first time you create through it, and pause it explicitly if it came back active. Going live is a separate step a human asks for by naming the entity. Never bundle activation into a create.
5. Empty is a finding. No campaigns, or insights with zero rows, is a real answer about a new or idle account. Report it plainly; do not retry or widen the date range unasked.
Every create, update, delete, connect, disconnect, and assign-user moves real money or real delivery. There is no draft/publish staging step like gtm has: the call lands on the live account immediately.
list/get the entities involved, so the change is described against what is actually there.--dry-run prints the exact command for the user to look at. Do not proceed on an inferred yes.Each action type must use at least one object, not eligible to set schedules for individual ads); pass them through rather than paraphrasing.meta_ads.py appends a line to .meta-ads-audit.jsonl at the repo root (nearest .git, else the working directory) with the timestamp, the redacted argv, the account, and the exit code. Writes made through the hosted MCP tools do not land there — Meta's own account activity log is the trail for those, and its activity-log tool is how you read it.delete is a cascade. campaign delete takes its ad sets and ads with it. Without --force the CLI prompts, which in a non-interactive agent shell aborts on EOF; --force is therefore only ever appropriate after step 2, never as a way to get past a prompt.ARCHIVED is the reversible option. update --status ARCHIVED keeps the entity and its history; delete does not. Prefer it whenever the user's intent is "stop this", and say so if they asked for a delete.The CLI read path is exercised: every list/get command in the map, plus insights get, has returned a real response from a live account. The MCP side is connected and its OAuth flow completed; ads_get_ad_accounts returned real data, which is where the tool count, the account-gating flags and the min_daily_budget_cents unit finding come from.
The write path is unexercised on both paths. No create/update/delete has run against a real account, so the audit log has only ever recorded a failing call. Treat your first write as the test: read the object the call returns rather than assuming it landed as asked, and confirm its status field before anything else.
META_ADS_ACCESS_TOKEN, never a bare ACCESS_TOKEN, in the shell environment — that generic name is what the wrapper remaps to for the subprocess, and what a stray .env uses to hijack the account.--account on every call, from the user or from adaccount list — never from an environment variable, never inferred from a previous session.ads page list output raw — it includes a live Page access token per Page (see reference/cli.md); strip access_token before showing or logging it.meta auth status is not verification — use meta_ads.py check.is_ads_mcp_enabled before using an account id in any MCP call, and is_queryable before ads_get_ad_entities; a false flag means stop, not retry.client_conversation_id across the whole conversation, and keep advertiser_request verbatim and free of personal data.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub codxse/nadiar-skills --plugin meta-ads