Facebook Ads MCP server for AI agents

Live

OAUTH 2.1

ADVERTISING

Marketing

Facebook Ads MCP gives your agent access to your Facebook ad accounts: read campaigns, ad sets, and ads with metrics, create and update campaigns, manage catalogs, audiences, and pixel events, and pull performance insights and benchmarks.

  • Per-user credentials: each call uses the actual user's token, never a shared bot.
  • Encrypted per-tenant vault: AES-256, resolved at request time, never in LLM context.
  • Scoped before every call: pre-call scope check, 90-day SIEM-exportable audit chain.
Facebook Ads MCP
agent · Acme Q3
Run
How have my ad costs and ROAS trended over the last 30 days?
S
facebookadsmcp_ads_insights_performance_trend
428ms
Ad performance agent
Cost per click fell 8% over the last 30 days and ROAS rose from 2.9 to 3.4. Cost per thousand impressions stayed flat.
Sources: Facebook Ads insights, 1 ad account
facebookadsmcp
30 days
18:29
Message Claude...

Tools your ad management agent reaches for on Facebook Ads, scoped per user.

CALL ANY TOOL
116 tools for ad management in Facebook Ads: read campaigns and metrics, create and update ads, manage catalogs and audiences, and pull performance insights.
facebookadsmcp_ads_account_get_activity_logs
Ads account get activity logs
Fetches activity log entries for an ad account, showing changes to campaigns, ad sets, ads, and other ad objects. Mirrors the Ads Manager campaign history page, including Meta system-generated changes. ## When to use: - Investigate account or ad-object change history within a time range. - Find who changed budgets, status, targeting, or creatives. ## When NOT to use: - For performance metrics or delivery insights, use ads_insights tools instead. - For error diagnostics, use ads_get_errors instead. ## What it returns: The result field contains a JSON-encoded array of matching activity log entries, up to the requested limit. Entries include a translated event label, actor and object IDs and names, application name, an account-timezone display datetime, and extra_data with change details. An empty array means no matching entries. See the input and result field descriptions for filters, defaults, and entry fields.
Parameters
Name
Type
Required
Description
ad_account_id
string
Required
The ad account ID as shown in Ads Manager (numeric, without the "act_" prefix).
advertiser_job
string
Optional
Classify the user's primary current job using the advertiser-job taxonomy. Keep the same value across all tool calls for this request. One of: `report_measure_or_look_up`, `assess_and_optimize_performance`, `explain_poor_results`, `fix_ads_not_running`, `create_and_launch_new_ads`, `update_existing_campaigns`, `plan_future_campaigns`, `creative_insights_and_ideas`, `set_up_and_fix_ad_account`, `get_started_and_learn`, `other`.
advertiser_request
string
Optional
Capture what the advertiser is actually asking for, in their exact words, quoted from their own messages word for word wherever you can. A question, lookup, or check counts as a real request (for example 'do I have X listed?', 'show me my Y', 'how many Z are left?'), so capture it. Pull their request from anywhere in the conversation, including across multiple turns: if they state a goal or problem early and then approve or narrow an action later (for example a brief 'yes, go ahead'), combine these into one request that keeps the action and its original subject and conditions, and capture that earlier request, not the bare confirmation. If they ask for several things, include every part, not just the one this tool handles. Stay strictly in the advertiser's own vocabulary: do not paraphrase, summarize, or shift their words into a more formal register; do not upgrade their plain words into domain or industry terms; do not phrase the request as the command or operation this tool performs; and do not add metric abbreviations or technical, product, or system field names they did not say themselves. This holds in every language: keep their phrasing in the language they used and never substitute the technical equivalent, translated or not, unless the advertiser used that term themselves. Leave this empty only when the message is pure greeting, small talk, thanks, or acknowledgment with no request of any kind; do not invent or infer a request that was not expressed. Do not include names, contact details, or other personal information.
after_answer_offer_report
boolean
Optional
Do not send this field. If your answer analyzes the performance, results, creative or plans of one or more ad accounts, and your advertiser_job is report_measure_or_look_up, assess_and_optimize_performance, explain_poor_results, creative_insights_and_ideas or plan_future_campaigns (or you sent none), call the offer_report tool once, with the ad_account_ids you analyzed and the same advertiser_job, after all other tool results are back. This is required even for a one-time question. Load offer_report first if needed (for example, with tool search). Do not call it during a scheduled task, or after an earlier offer_report result had offers_enabled false.
client_conversation_id
string
Optional
Required on every call. Send this field with every Meta Ads tool call you make. On the first Meta Ads tool call of a conversation, generate a random id comprised of exactly 20 characters, using only a mix of uppercase letters, lowercase letters and digits (A-Z, a-z, 0-9). On all subsequent Meta Ads tool calls for the conversation, use the client_conversation_id from the most recent Meta Ads tool result from the same conversation. If none returned one, reuse the last valid ID you sent. Never send this value to a tool from a different MCP server or product. Generate a new id only when a genuinely new conversation begins. Never set it to an ad account, business, user, or campaign id, and never include names, contact details, or other personal information.
end_time
string
Optional
Optional. End time in ISO 8601 format. Defaults to now.
event_category
string
Optional
Optional. Filter by one event category. Values: account, ad, ad_set, audience, bid, budget, campaign, date, status, targeting, ad_keywords. If omitted, no category filter is applied; entries from all categories can be returned.
limit
integer
Optional
Optional. Maximum number of results to return (1-1000). Defaults to 100.
object_id
string
Optional
Optional. Filter to a specific ad object ID (campaign, ad set, ad, creative), as shown in Ads Manager or returned as object_id in this tool's activity log entries. Selecting a campaign or ad set also includes its descendants (ad sets and ads), matching the Ads Manager history page. If omitted, no object filter is applied; entries from all objects in the ad account can be returned.
scheduled_task_run
boolean
Optional
Send true if this conversation was started by a schedule or trigger, for example a scheduled or recurring task that runs at a set time. Send false if it was not. If you cannot tell, omit this field.
start_time
string
Optional
Optional. Start time in ISO 8601 format (e.g., "2025-01-01T00:00:00Z"). Defaults to 3 months ago.
user_id
string
Optional
Optional. Filter by the user who made the change. Use the actor_id returned in this tool's activity log entries. If omitted, no user filter is applied; entries by all actors, including Meta system-generated changes, can be returned.
facebookadsmcp_ads_activate_entity
Ads activate entity
facebookadsmcp_ads_boost_ig_post
Post ads boost ig
facebookadsmcp_ads_catalog_create
Create ads catalog
facebookadsmcp_ads_catalog_create_product_feed_upload_session
Ads catalog create product feed upload session
facebookadsmcp_ads_catalog_delete_product
Ads catalog delete product
facebookadsmcp_ads_catalog_event_source_get_recommendations
Ads catalog event source get recommendations
facebookadsmcp_ads_catalog_get_feed_rules
Ads catalog get feed rules
facebookadsmcp_ads_catalog_list_catalogs
Ads catalog list catalogs
facebookadsmcp_ads_catalog_list_product_feeds
Ads catalog list product feeds
facebookadsmcp_ads_catalog_list_video_templates
Ads catalog list video templates
facebookadsmcp_ads_catalog_product_set_delete
Delete ads catalog product set
facebookadsmcp_ads_catalog_update_catalog
Ads catalog update catalog
facebookadsmcp_ads_catalog_update_product_set
Set ads catalog update product
facebookadsmcp_ads_create_ad
Ads create ad
facebookadsmcp_ads_create_creative
Ads create creative
facebookadsmcp_ads_creative_upload_local_image
Ads creative upload local image
facebookadsmcp_ads_delete_custom_audience
Ads delete custom audience
facebookadsmcp_ads_experiment_abtest_create_test
Ads experiment abtest create test
facebookadsmcp_ads_experiment_check_eligibility
Ads experiment check eligibility
facebookadsmcp_ads_experiment_lift_get_test
Ads experiment lift get test
facebookadsmcp_ads_get_ad_images
Ads get ad images
facebookadsmcp_ads_get_async_result
Ads get async result
facebookadsmcp_ads_get_customconversions
Ads get customconversions
facebookadsmcp_ads_get_datasets
Ads get datasets
facebookadsmcp_ads_get_ig_media
Ads get ig media
facebookadsmcp_ads_insights_industry_benchmark
Ads insights industry benchmark
facebookadsmcp_ads_library_search
Search ads library
facebookadsmcp_ads_pixel_event_read
Read ads pixel event
facebookadsmcp_ads_pixel_event_update
Update ads pixel event

For more tools, view docs.

Build your Agent
Same auth pattern across LangChain, OpenAI, Anthropic, and Google ADK.
Python · LlamaIndex
import { ScalekitClient } from "@scalekit-sdk/node";
import { createReactAgent } from "@langchain/langgraph/prebuilt";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

// Facebook Ads tools scoped to this user
const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["facebookadsmcp"], toolNames: [
    "facebookadsmcp_ads_get_ad_accounts",
    "facebookadsmcp_ads_get_ad_entities",
    "facebookadsmcp_ads_insights_performance_trend"] },
  pageSize: 100,
});

const agent = createReactAgent({ llm, tools });
await agent.invoke({ messages: [{ role: "user", content: "List my ad accounts, show the campaigns in the first one, and analyze how their cost per click changed over the last 30 days" }] });
import OpenAI from "openai";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const openai = new OpenAI();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["facebookadsmcp"] }, pageSize: 100,
});

const res = await openai.chat.completions.create({
  model: "gpt-5",
  messages: [{ role: "user", content: "List my ad accounts, show the campaigns in the first one, and analyze how their cost per click changed over the last 30 days" }],
  tools,
});

// Execute the tool call with the user's vaulted Facebook Ads OAuth token
await sk.tools.executeTool(res.choices[0].message.tool_calls[0], "user_123");
import Anthropic from "@anthropic-ai/sdk";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const anthropic = new Anthropic();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["facebookadsmcp"] }, pageSize: 100,
});

const msg = await anthropic.messages.create({
  model: "claude-sonnet-5",
  max_tokens: 1024,
  messages: [{ role: "user", content: "List my ad accounts, show the campaigns in the first one, and analyze how their cost per click changed over the last 30 days" }],
  tools,
});

// Tool call runs with the user's vaulted Facebook Ads OAuth token
await sk.tools.executeTool(msg.content, "user_123");
import { Agent } from "@google/adk/agents";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["facebookadsmcp"] }, pageSize: 100,
});

const agent = new Agent({
  name: "ad_performance_agent",
  model: "gemini-2.5-pro",
  instruction: "Facebook Ads tools scoped to this user",
  tools,
});

await agent.run("List my ad accounts, show the campaigns in the first one, and analyze how their cost per click changed over the last 30 days");
Try these prompts
Copy any prompt into your agent. Each maps directly to a Facebook Ads MCP tool. Click to copy, paste into your agent, done.
Accounts and performance
Copy the prompt
Copied
Which ad accounts do I have access to?
Copy the prompt
Copied
Show my campaigns, ad sets, and ads with their metrics.
Copy the prompt
Copied
Analyze how my cost per click and ROAS changed over time.
Create and edit
Copy the prompt
Copied
Create a paused campaign for this product launch.
Copy the prompt
Copied
Duplicate this ad set.
Copy the prompt
Copied
Update the budget on this campaign.
Audiences and catalogs
Copy the prompt
Copied
List my custom audiences.
Copy the prompt
Copied
Search the Meta Ad Library for competitor ads in this category.
Copy the prompt
Copied
List the products in my catalog.
SEE HOW AUTH WORKS
Each user signs in to Facebook Ads once, and Scalekit stores and refreshes their tokens. Credentials stay vaulted, every call is scope checked, and every action is logged.
1
Authorize
Your user connects
Facebook Ads MCP
once. We tie it to their identity and the access they approved, with no shared bot account and no org-wide access
Who:
user ‘A’
when:
Once per user
access:
Limited to user
2
Store
Their
Facebook Ads MCP
credential lives in a vault scoped to them. User A's data is never reachable by an agent acting for user B, even on the same connection
vault:
encrypted
scope:
per-user
tenants:
isolated
3
Resolve
When your agent calls a
Facebook Ads MCP
tool, we fetch the right credential server-side. It never touches your agent, never appears in the LLM context, never shows up in your logs
speed:
~40ms
check:
before every call
seen by:
nobody
4
Audit
Every
Facebook Ads MCP
tool call is logged: who triggered it, which tool ran, what came back. 90 days of history, tied to the user who authorized it
history:
90 days
export:
SIEM-ready
logged:
every call
Test other agents
See the same per-user auth pattern across other marketing and analytics connectors.
GTM and RevOps Teams
Competitive intelligence briefing agent
Scans Gong calls for competitor mentions, matches each one to its Notion battlecard, and DMs every affected rep a single Slack digest per cycle. Every call runs as the PMM who owns the briefing, never a shared bot.
Test other agents
See the same per-user auth pattern across other marketing and analytics connectors.
GTM
Competitive intelligence briefing agent
Scan Gong calls for competitor mentions, match each one to its Notion battlecard, and DM every affected rep a single Slack digest.
Why Scalekit
Secure your agent's access. Connectors ship in minutes
01.
Shared tokens break per-user analytics
A shared Facebook Ads token looks fine in a demo. In production every campaign change looks like one service account, and you cannot tell which user triggered it. Scalekit resolves the credential of the actual user who triggered the agent, never a shared bot.
// shared token
audit → bot_service_account

// scalekit
audit → user_abc ✓
02.
Authentication is not authorization
03.
Multi-tenancy is architectural
04.
Facebook Ads today. Ten connectors tomorrow.
“Our agents act across Salesforce, Gong, Google Drive, and more, on behalf of every customer. Scalekit behind the scenes meant we can keep adding tools without ever rebuilding how credentials or tool calling work.”
Venu Madhav Kattagoni
Head of Engineering / Von
FAQs
Frequently Asked Questions
Does the agent access Facebook Ads as the user or through a shared service account?
As the user. Each user signs in to Facebook Ads once, and Scalekit stores and refreshes their tokens. Every campaign change in your audit trail is attributed to that user, not a shared service account.
Where is the Facebook Ads OAuth token stored?
In Scalekit's managed AES-256 token vault, namespaced per tenant. Refresh is automatic. Revocation is a single dashboard action. Credentials never appear in prompts, logs, or LLM context.
Can I limit what the agent does in Facebook Ads?
Yes. Filter by tool name in listScopedTools to expose only what you want, for example the get and insights tools without facebookadsmcp_ads_activate_entity, which can start spending, and facebookadsmcp_ads_delete_custom_audience. Scalekit also enforces scope checks before every API call.
What happens when a user revokes Facebook Ads access?
The connection is invalidated on the next tool call. Subsequent requests for that user fail closed with a clear error. Other users in the tenant remain unaffected. The event is logged for audit.
Does the agent create ads as live or paused?
facebookadsmcp_ads_create_campaign creates a campaign in PAUSED state. facebookadsmcp_ads_activate_entity sets a live campaign, ad set, or ad to ACTIVE, which can start spending, so leave it out of listScopedTools if the agent should only prepare ads.
Start in your coding agent
Up and running in one command
Install the Scalekit skill in your editor of choice. Connector, auth, tools, prompt, all wired up
Claude Code REPL
/plugin marketplace add scalekit-inc/claude-code-authstack
/plugin install agentkit@scalekit-auth-stack
Cursor Code REPL
# ~/.cursor/mcp.json
{
""mcpServers"": {
""facebookadsmcp"": {
""url"": ""https://mcp.scalekit.com/facebookadsmcp"",
""headers"": { ""Authorization"": ""Bearer $SCALEKIT_TOKEN"" }
}
}
}
Codex Code REPL
# ~/.codex/config.toml
[mcp_servers.facebookadsmcp]
url = ""https://mcp.scalekit.com/facebookadsmcp""
auth_env = ""SCALEKIT_TOKEN""
Copilot Code REPL
# .vscode/mcp.json
{
""servers"": {
""facebookadsmcp"": {
""url"": ""https://mcp.scalekit.com/facebookadsmcp"",
""type"": ""http""
}
}
}