{
  "markdown": "# meta-ads-mcp-server\n\n[![CI](https://github.com/getmcpads-com/meta-ads-mcp-server/actions/workflows/ci.yml/badge.svg)](https://github.com/getmcpads-com/meta-ads-mcp-server/actions/workflows/ci.yml)\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)\n[![Node](https://img.shields.io/badge/node-%E2%89%A518-brightgreen.svg)](package.json)\n\nAn open-source [Model Context Protocol](https://modelcontextprotocol.io) server for the\n**Facebook (Meta) Ads Marketing API**. It lets Claude, ChatGPT, Cursor or any MCP client\nread and analyse your advertising data, and change it if you choose to.\n\nYou run it. Your token stays on your machine. Nothing is proxied through a third party.\n\n```bash\nnpx -y @getmcpads/meta-ads-mcp-server\n```\n\nAlso listed in the [MCP Registry](https://registry.modelcontextprotocol.io) as **`com.getmcpads/meta-ads`**, so clients that read the registry can install it by name.\n\n> **Prefer not to run it yourself?** [getmcpads.com](https://www.getmcpads.com) is the hosted\n> version of this server, with Meta Ads alongside Google Ads, TikTok Ads, Pinterest Ads, GA4 and\n> Search Console behind a single endpoint, hosted OAuth, and cross-platform reporting.\n> Same tools, same safety model, no setup.\n\n---\n\n## What you get\n\n| | |\n|---|---|\n| **34 read tools** | Campaigns, ad sets, ads, creatives, audiences, pixels, catalogs, Pages, Instagram, activity logs, A/B tests and lift studies |\n| **10 write tools** | Off by default. Status, budgets, schedules, renames, campaign creation. Each one **previews before it applies** |\n| **190 metrics** | Including derived ones computed client-side (ROAS, CPA, frequency, hook rate, attribution-window views) |\n| **56 breakdowns · 90 dimensions** | With a compatibility matrix that catches invalid combinations *before* they hit the API |\n| **7 resources** | Live catalogues the model can read: metrics, breakdowns, compatibility rules, 11 workflow recipes |\n| **Forward-compatible reads** | `meta_get_node_fields`, `meta_list_edge_raw`, `meta_get_insights_raw` reach Graph fields this server doesn't model yet |\n\n### The query planner\n\nMeta rejects many metric/breakdown combinations, and the error messages rarely say why.\nThis server encodes the compatibility matrix, so it **splits an impossible request into\nseveral valid API calls and merges the results** instead of failing.\n\n`meta_validate_query` lets the model check a combination before spending a call on it.\nThat is the difference between an assistant that reports \"the API returned error 100\" and\none that returns your numbers.\n\n---\n\n## How this compares to Meta's own MCP server\n\nMeta ships an official MCP server, hosted at `mcp.facebook.com/ads`. It is a good product.\nHere is an honest comparison, because the right choice depends on what you need.\n\n| | **This server** | Meta's official server | [getmcpads.com](https://www.getmcpads.com) |\n|---|---|---|---|\n| Hosting | **You host it.** stdio, local process | Meta-hosted, remote | Hosted for you |\n| Data path | **Direct to the Graph API.** No intermediary | Through Meta's endpoint | Through our gateway |\n| Auth | You bring a token, which is more setup (see below) | Meta Business OAuth, 2 clicks | Hosted OAuth |\n| Tools | **44** (34 read + 10 write) | 29 | 44, plus 5 other platforms |\n| Writes | **Preview first**, applied only on `confirm: true` | Applied directly | Preview first |\n| Metric compatibility | **Query planner splits incompatible requests** | None | Same planner |\n| Auditable | **Yes.** Apache-2.0, read every line | No | This server, audited |\n| Modifiable | **Fork it** | No | No |\n| Help Center search | **No** | Yes | No |\n| Catalog creation | ✅ | ❌ (catalog *reads* are supported) | ❌ |\n\n**Choose Meta's** if you want the fastest possible setup and don't need to see the code.\n**Choose this one** if you need your data to stay on your infrastructure, want to audit or\nextend what the model can do, or want writes that can't fire on the first call.\n**Choose [getmcpads.com](https://www.getmcpads.com)** if you want this server's capabilities\nwithout running it, or you need more than one ad platform in the same conversation.\n\n---\n\n## Getting a token\n\nThis is the one step that takes real effort, and it's worth doing properly.\n\nYou need a Meta access token with **`ads_read`**. There are three ways to get one; the\nsecond is the one we recommend.\n\n### Recommended: System User token (does not expire)\n\nA System User belongs to your Business, not to a person. Its token survives password\nchanges and staff departures, and **needs no App Review** to access ad accounts your\nBusiness already owns.\n\n1. Go to [Business Settings](https://business.facebook.com/settings) → **Users → System Users**\n2. **Add** a system user. Give it the *Employee* role unless you need more.\n3. **Assign Assets** → select your ad accounts → grant **View performance** (add\n   *Manage campaigns* only if you plan to enable writes).\n4. **Generate New Token** → pick your app → select scope **`ads_read`**\n   (add `ads_management` only for writes).\n5. Set the expiry to **Never**.\n6. Copy the token. Meta shows it once.\n\n📖 [Meta's System User documentation](https://developers.facebook.com/docs/marketing-api/system-users)\n\n### Quick test: Graph API Explorer (expires in ~1 hour)\n\nFine for trying the server out, useless for daily work.\n[Graph API Explorer](https://developers.facebook.com/tools/explorer/) → select your app →\nadd `ads_read` → **Generate Access Token**.\n\n### Long-lived user token (~60 days)\n\nExchange a short-lived token for a 60-day one. You will have to redo this every two months.\n📖 [Long-lived tokens](https://developers.facebook.com/docs/facebook-login/guides/access-tokens/get-long-lived)\n\n### Which permissions?\n\n| Permission | When you need it |\n|---|---|\n| `ads_read` | **Always.** Campaigns, insights, everything read-only |\n| `ads_management` | Only if you set `META_ENABLE_WRITES=1` |\n| `business_management` | Optional. Business Manager asset discovery |\n| `pages_show_list`, `pages_read_engagement` | Optional. Page posts and organic enrichment |\n| `instagram_basic` | Optional. Linked Instagram accounts |\n| `catalog_management` | Optional. Product catalog reads |\n\nRun **`meta_health_check`** as your first call: it reports which scopes you actually have\nand which ones are missing for the tools you tried to use, without printing your token.\n\n---\n\n## Setup\n\n### Claude Desktop\n\n`~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)\nor `%APPDATA%\\Claude\\claude_desktop_config.json` (Windows):\n\n```json\n{\n  \"mcpServers\": {\n    \"meta-ads\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@getmcpads/meta-ads-mcp-server\"],\n      \"env\": {\n        \"META_ACCESS_TOKEN\": \"your-token-here\"\n      }\n    }\n  }\n}\n```\n\nRestart Claude Desktop. Ask it: *\"list my Meta ad accounts\"*.\n\n### Claude Code\n\n```bash\nclaude mcp add meta-ads --env META_ACCESS_TOKEN=your-token-here -- npx -y @getmcpads/meta-ads-mcp-server\n```\n\n### Cursor\n\n`.cursor/mcp.json` in your project, same shape as the Claude Desktop config above.\n\n### From source\n\n```bash\ngit clone https://github.com/getmcpads-com/meta-ads-mcp-server.git\ncd meta-ads-mcp-server\nnpm install && npm run build\ncp .env.example .env   # then fill in META_ACCESS_TOKEN\nnpm start\n```\n\n### Configuration\n\n| Variable | Default | Meaning |\n|---|---|---|\n| `META_ACCESS_TOKEN` | none | **Required.** Your Meta access token |\n| `META_ENABLE_WRITES` | *unset* | Set to `1` to register the 10 write tools |\n| `META_API_VERSION` | `v26.0` | Graph API version. Override to pin another |\n| `LOG_LEVEL` | `info` | `debug`, `info`, `warn`, `error` |\n\nCheck your setup at any time:\n\n```bash\nnpm run doctor\n```\n\n---\n\n## Writes, and why they preview first\n\nWrite tools are **disabled by default**. Enable them with `META_ENABLE_WRITES=1`.\n\nWhen enabled, every write tool returns a preview and changes nothing:\n\n```jsonc\n// meta_update_adset_budget { adSetId: \"123\", currency: \"EUR\", dailyBudget: 50 }\n{\n  \"applied\": false,\n  \"action\": \"meta_update_adset_budget\",\n  \"change\": { \"adSet\": \"123\", \"field\": \"daily_budget\", \"amount\": 50,\n              \"currency\": \"EUR\", \"inMinorUnits\": 5000 },\n  \"message\": \"Preview only, nothing was changed. Repeat the same call with confirm: true to apply this change to the live account.\"\n}\n```\n\nOnly a second call carrying `confirm: true` touches the live account.\n\nThis is deliberate. An assistant composes these calls, and it can pick the wrong account,\nthe wrong campaign, or the wrong order of magnitude on a budget. A mandatory preview makes\nthe mistake visible before it costs money, and gives a human the stopping point the\nprotocol does not guarantee on its own.\n\nTwo further guardrails:\n\n- **`meta_create_campaign` always creates the campaign `PAUSED`.** There is no option to\n  create it active.\n- **Budgets are converted to minor units per currency.** The yen, the won and the CFA franc\n  have no subunit, so sending 1250 for ¥12.50 would multiply the spend by a hundred. The\n  server knows the zero-decimal currencies.\n\n| Tool | What it changes |\n|---|---|\n| `meta_update_campaign_status` / `_adset_status` / `_ad_status` | Pause or reactivate |\n| `meta_update_campaign_budget` / `_adset_budget` | Daily or lifetime budget |\n| `meta_update_adset_schedule` | Start and end time |\n| `meta_rename_campaign` / `_adset` / `_ad` | Name only |\n| `meta_create_campaign` | Creates a campaign, always `PAUSED` |\n\n---\n\n## Tools\n\n<details>\n<summary><b>34 read tools</b></summary>\n\n### Discovery and health\n| Tool | Purpose |\n|---|---|\n| `meta_health_check` | Validates the token, lists accessible accounts, reports missing scopes |\n| `meta_debug_token` | Token validity, expiry and granted scopes |\n| `meta_list_ad_accounts` | Every ad account the token can reach |\n| `meta_get_account_details` | Currency, timezone, spend cap, status, business info |\n| `meta_get_business_assets` | Businesses, Pages, Instagram accounts, pixels, datasets |\n\n### Structure\n| Tool | Purpose |\n|---|---|\n| `meta_get_campaigns` / `meta_get_adsets` / `meta_get_ads` | List entities, filterable by parent |\n| `meta_get_campaign_structure` | Full hierarchy: campaigns → ad sets → ads |\n| `meta_search_entities` | Search by name within an account |\n| `meta_get_ad_activity` | Activity log: who changed what, and when |\n\n### Performance\n| Tool | Purpose |\n|---|---|\n| `meta_get_insights` | The main reporting tool. Metrics, breakdowns, attribution windows |\n| `meta_validate_query` | Check a metric/breakdown combination *before* running it |\n| `meta_get_insights_raw` | Native Insights fields, no aliasing |\n| `meta_get_delivery_diagnostics` | Why delivery is limited: statuses and issues |\n\n### Creatives\n| Tool | Purpose |\n|---|---|\n| `meta_get_creatives` | Text, images, videos, links, CTAs |\n| `meta_get_creative_assets` | Normalised asset metadata, media URLs, asset feeds |\n| `meta_get_ad_preview` | Rendered preview markup for a placement |\n\n### Audiences and targeting\n| Tool | Purpose |\n|---|---|\n| `meta_get_audiences` / `meta_get_audience_details` | Custom, saved and lookalike audiences |\n| `meta_search_targeting_options` | Interests, geographies, locales, cities, postal codes |\n| `meta_get_brand_safety_controls` | Suitability, placement and context controls |\n\n### Commerce and organic\n| Tool | Purpose |\n|---|---|\n| `meta_get_catalog_products` | Product catalogs and items |\n| `meta_join_product_insights` | Product-breakdown insights enriched with catalog metadata |\n| `meta_get_pixels` | Pixels and datasets |\n| `meta_get_pages` / `meta_get_page_posts` | Pages and their recent posts |\n| `meta_get_instagram_accounts` | Linked Instagram accounts |\n| `meta_get_organic_content_enrichment` | Media URLs, permalinks, counts for organic content |\n\n### Experiments\n| Tool | Purpose |\n|---|---|\n| `meta_get_ad_studies` | Conversion lift studies and A/B tests |\n| `meta_get_study_results` | Detailed study results |\n| `meta_interpret_experiment_results` | Results with confidence guardrails |\n\n### Escape hatches\n| Tool | Purpose |\n|---|---|\n| `meta_get_node_fields` | Read flat fields from any Graph node |\n| `meta_list_edge_raw` | List an allowlisted Graph edge with your own field selection |\n\nThese last two exist so a new Graph field doesn't require a new release. The edge allowlist\ndeliberately **excludes lead records**, which carry personal data.\n\n</details>\n\n<details>\n<summary><b>7 resources</b></summary>\n\n| URI | Contents |\n|---|---|\n| `meta://manifest` | What this server exposes, and which tool to run first |\n| `meta://metrics` | All 190 metrics with categories and formats |\n| `meta://breakdowns` | All 56 breakdowns and where they are valid |\n| `meta://compatibility` | The compatibility matrix, 90 dimensions |\n| `meta://recipes` | 11 step-by-step workflows |\n| `meta://p2-readonly` | Read-only scope guidance |\n| `meta://app-review` | Scope positioning for a Meta App Review submission |\n\n</details>\n\n---\n\n## Security\n\nThe server holds a credential that can read live ad accounts, and modify them when writes\nare enabled.\nConcretely:\n\n- **The token is never logged**, at any log level, and never written to disk.\n- **Requests go only to `graph.facebook.com`** on the pinned version. Any other host is\n  refused rather than called. *Covered by tests.*\n- **Redirects are refused once a token is attached**, so a redirect cannot forward your\n  credential elsewhere. *Covered by tests.*\n- **No telemetry.** The server makes no network call other than to the Graph API. There is\n  no analytics, no phone-home, and no usage reporting. You can verify this by grepping\n  the source for `fetch`.\n\nFull policy and reporting instructions: [SECURITY.md](SECURITY.md).\n\n---\n\n## Looking for a managed, multi-platform version?\n\nThis server does one platform, on your machine, with your token. That is on purpose.\n\nIf you'd rather not run it yourself, or you need Facebook Ads **alongside Google Ads,\nTikTok Ads, Pinterest Ads, GA4 and Search Console** behind one endpoint, with hosted OAuth\nand cross-platform reporting, that's what we build at **[getmcpads.com](https://www.getmcpads.com)**.\n\nSame philosophy, less plumbing. This project stays open source and independently useful\neither way.\n\n---\n\n## Contributing\n\nIssues and pull requests are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md).\nPlease read [SECURITY.md](SECURITY.md) before reporting anything security-related.\n\n## Licence\n\n[Apache License 2.0](LICENSE). See also [NOTICE](NOTICE).\n\nFacebook, Meta, Instagram and the Meta Marketing API are trademarks of Meta Platforms, Inc.\n**This project is not affiliated with, endorsed by, or sponsored by Meta Platforms, Inc.**\nIt is an independent client of a public API.\n",
  "bytes": 14693,
  "sha": "f18b3eda72f078b2e476621ce2ebfc1c09e42a77f1d365b5b539f0a852bf9fff",
  "repo_slug": "getmcpads-com/meta-ads-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_com_getmcpads_meta_ads_35e673af/readme"
}