Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{/* TODO: stub cloned from _section-after-setup-atlassianmcp-common-workflows.mdx for Facebook Ads MCP. Review and update connector-specific references (URLs, scopes, app-registration steps) before merging. */}
export const sectionTitle = 'Common workflows'

import { Tabs, TabItem, Aside } from '@astrojs/starlight/components'

### Get your cloud ID

Most Facebook Ads MCP tools require a `cloudId` — the UUID that identifies your Atlassian cloud site. Call `facebookadsmcp_getaccessibleatlassianresources` once to retrieve it, then pass the `id` field value in every subsequent tool call.

<Aside type="note" title="Call this tool first">
Run `facebookadsmcp_getaccessibleatlassianresources` before calling any Jira or Confluence tool. The response lists every Atlassian site the user has access to. Use the `id` field as `cloudId`.
</Aside>

<Tabs syncKey="tech-stack">
<TabItem label="Node.js">
```typescript
// Step 1 — get the cloud ID
const resources = await actions.executeTool({
connectionName: 'facebookadsmcp',
identifier: 'user_123',
toolName: 'facebookadsmcp_getaccessibleatlassianresources',
toolInput: {},
});
const cloudId = resources[0].id;

// Step 2 — use cloudId in subsequent calls
const issue = await actions.executeTool({
connectionName: 'facebookadsmcp',
identifier: 'user_123',
toolName: 'facebookadsmcp_getjiraissue',
toolInput: {
cloudId,
issueIdOrKey: 'KAN-1',
},
});
console.log(issue);
```
</TabItem>
<TabItem label="Python">
```python
# Step 1 — get the cloud ID
resources = actions.execute_tool(
connection_name="facebookadsmcp",
identifier="user_123",
tool_name="facebookadsmcp_getaccessibleatlassianresources",
tool_input={},
)
cloud_id = resources[0]["id"]

# Step 2 — use cloud_id in subsequent calls
issue = actions.execute_tool(
connection_name="facebookadsmcp",
identifier="user_123",
tool_name="facebookadsmcp_getjiraissue",
tool_input={
"cloudId": cloud_id,
"issueIdOrKey": "KAN-1",
},
)
print(issue)
```
</TabItem>
</Tabs>

The `facebookadsmcp_getaccessibleatlassianresources` response looks like this:

```json
[
{
"id": "a4c9b3e2-1234-5678-abcd-ef0123456789",
"name": "My Company",
"url": "https://mycompany.atlassian.net",
"scopes": ["read:jira-work", "write:jira-work", "read:confluence-content.all"]
}
]
```

Use `id` as the `cloudId` parameter. If the user belongs to multiple Atlassian sites, the list contains one entry per site — pick the one matching the target `url`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{/* TODO: stub cloned from _setup-atlassianmcp.mdx for Facebook Ads MCP, then rewritten for bring-your-own OAuth 2.1 with PKCE. Add screenshots and verify provider-specific navigation before merging. */}
import { Steps, Aside } from '@astrojs/starlight/components'

Facebook Ads MCP uses OAuth 2.1 with PKCE. Meta's Ads MCP server advertises Dynamic Client Registration (DCR) support, but its registration endpoint rejects DCR requests — so you need to register your own OAuth app in Meta's developer console and add the client ID and secret to Scalekit.

<Steps>
1. ### Copy the redirect URI from Scalekit

In the [Scalekit dashboard](https://app.scalekit.com), go to **AgentKit** > **Connections** > **Create Connection**. Find **Facebook Ads MCP** and click **Create**. Copy the redirect URI — it looks like `https://<SCALEKIT_ENVIRONMENT_URL>/sso/v1/oauth/<CONNECTION_ID>/callback`.

{/* TODO: add screenshot — alt: "Copy redirect URI from Scalekit dashboard for Facebook Ads MCP", original src: @/assets/docs/agent-connectors/facebookadsmcp/copy-redirect-uri.png */}

2. ### Create an OAuth app in Meta for Developers

{/* TODO: add provider-specific steps — exact navigation for creating a Business app with the Marketing API / Ads Management Standard Access product in the current Meta for Developers console, since Meta's app dashboard changes layout periodically. */}

- Go to [developers.facebook.com/apps](https://developers.facebook.com/apps) and create (or select) an app with access to the Marketing API.
- Under the app's **Facebook Login for Business** (or equivalent OAuth) settings, add the redirect URI you copied from Scalekit to the list of valid OAuth redirect URIs.
- Request the scopes your agent needs. At minimum:
- `ads_management` — create and manage ad campaigns, ad sets, and ads
- `ads_read` — read ad account, campaign, and reporting data
- `business_management` — manage business assets (ad accounts, catalogs, pages) under a Business Manager
- Depending on your use case, also request:
- `catalog_management` — create and manage product catalogs for ads
- `instagram_basic` — read basic Instagram account info for ad placements
- `pages_show_list` — list Facebook Pages the user manages
- `ads_mcp_management` — MCP-server-specific management scope for the Ads MCP tool surface

{/* TODO: add screenshot — alt: "Configure OAuth redirect URI and scopes in Meta for Developers", original src: @/assets/docs/agent-connectors/facebookadsmcp/meta-app-oauth-settings.png */}

3. ### Get the client ID and client secret

In your Meta app's **Settings** > **Basic** page, copy the **App ID** and **App Secret**. Meta apps typically start in development mode — submit the app for App Review (or add test users) before real customer accounts can authorize it.

{/* TODO: add screenshot — alt: "App ID and App Secret in Meta app basic settings", original src: @/assets/docs/agent-connectors/facebookadsmcp/meta-app-credentials.png */}

<Aside type="note" title="App Review required for production">
Meta requires App Review approval for `ads_management` and most other advertising scopes before your app can access live ad accounts beyond its own test users.
</Aside>

4. ### Add the credentials to Scalekit

Back in the Scalekit dashboard's **Create Connection** flow for **Facebook Ads MCP**, paste the **App ID** as the client ID and the **App Secret** as the client secret, then save. Scalekit stores these credentials, drives the OAuth 2.1 + PKCE flow, and manages token storage and refresh for every user who authorizes the connection.

{/* TODO: add screenshot — alt: "Add client ID and client secret for Facebook Ads MCP in Scalekit dashboard", original src: @/assets/docs/agent-connectors/facebookadsmcp/add-credentials-scalekit.png */}
</Steps>
2 changes: 2 additions & 0 deletions src/components/templates/agent-connectors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export { default as SetupDropboxSection } from './_setup-dropbox.mdx'
export { default as SetupDropboxmcpSection } from './_setup-dropboxmcp.mdx'
export { default as SetupExaSection } from './_setup-exa.mdx'
export { default as SetupExamcpSection } from './_setup-examcp.mdx'
export { default as SetupFacebookadsmcpSection } from './_setup-facebookadsmcp.mdx'
export { default as SetupFathomSection } from './_setup-fathom.mdx'
export { default as SetupFellowaimcpSection } from './_setup-fellowaimcp.mdx'
export { default as SetupFigmaSection } from './_setup-figma.mdx'
Expand Down Expand Up @@ -170,6 +171,7 @@ export { default as SectionAfterSetupDiarizeCommonWorkflows } from './_section-a
export { default as SectionAfterSetupDiscordCommonWorkflows } from './_section-after-setup-discord-common-workflows.mdx'
export { default as SectionAfterSetupDropboxCommonWorkflows } from './_section-after-setup-dropbox-common-workflows.mdx'
export { default as SectionAfterSetupExaCommonWorkflows } from './_section-after-setup-exa-common-workflows.mdx'
export { default as SectionAfterSetupFacebookadsmcpCommonWorkflows } from './_section-after-setup-facebookadsmcp-common-workflows.mdx'
export { default as SectionAfterSetupFathomCommonWorkflows } from './_section-after-setup-fathom-common-workflows.mdx'
export { default as SectionAfterSetupFellowaimcpCommonWorkflows } from './_section-after-setup-fellowaimcp-common-workflows.mdx'
export { default as SectionAfterSetupFigmaCommonWorkflows } from './_section-after-setup-figma-common-workflows.mdx'
Expand Down
89 changes: 89 additions & 0 deletions src/content/docs/agentkit/connectors/facebookadsmcp.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
title: 'Facebook Ads MCP connector'
tableOfContents: true
description: 'Use Facebook Ads MCP to manage ad campaigns, catalogs, reporting, signals, and A/B tests from your AI agent.'
sidebar:
label: 'Facebook Ads MCP'
overviewTitle: 'Quickstart'
connectorIcon: https://cdn.scalekit.com/sk-connect/assets/provider-icons/facebook.svg
connectorAuthType: OAuth2.1
connectorCategories: [Marketing, Analytics]
head:
- tag: style
content: |
.sl-markdown-content h2 {
font-size: var(--sl-text-xl);
}
.sl-markdown-content h3 {
font-size: var(--sl-text-lg);
}
---

import ToolList from '@/components/ToolList.astro'
import { tools } from '@/data/agent-connectors/facebookadsmcp'
import { Steps, Tabs, TabItem } from '@astrojs/starlight/components'
import { AgentKitCredentials } from '@components/templates'
import { SetupFacebookadsmcpSection } from '@components/templates'
import { QuickstartGenericOauthSection } from '@components/templates'
import { SectionAfterSetupFacebookadsmcpCommonWorkflows } from '@components/templates'

<Steps>

1. ### Install the SDK

<Tabs syncKey="tech-stack">
<TabItem label="Node.js">
```bash frame="terminal"
npm install @scalekit-sdk/node
```
</TabItem>
<TabItem label="Python">
```bash frame="terminal"
pip install scalekit
```
</TabItem>
</Tabs>

Full SDK reference: [Node.js](/agentkit/sdks/node/) | [Python](/agentkit/sdks/python/)

2. ### Set your credentials

<AgentKitCredentials />

3. ### Set up the connector

Register your Facebook Ads MCP credentials with Scalekit so it handles the token lifecycle. You do this once per environment.

<details>
<summary>Dashboard setup steps</summary>

<SetupFacebookadsmcpSection />

</details>

4. ### Authorize and make your first call

<QuickstartGenericOauthSection connector="facebookadsmcp" toolName="facebookadsmcp_ads_library_search" providerName="Facebook Ads MCP" />

</Steps>

## What you can do

Connect this agent connector to let your agent:

- **Manage campaigns and ads** — create, activate, pause, and update campaigns, ad sets, and ads, including boosting Instagram posts
- **Manage product catalogs** — create and update catalogs, product feeds, and product sets for dynamic and Advantage+ catalog ads
- **Work with signals and datasets** — connect event sources, manage datasets, and check catalog and dynamic ads health and diagnostics
- **Run A/B tests and Conversion Lift studies** — set up and monitor split tests and lift studies to measure ad performance
- **Pull reporting and insights** — fetch account, campaign, and ad-level performance data
- **Review activity logs** — fetch the change history for ad accounts, campaigns, ad sets, and ads

## Common workflows

<SectionAfterSetupFacebookadsmcpCommonWorkflows />

## Tool list

Use the exact tool names from the **Tool list** below when you call `execute_tool`. If you're not sure which name to use, list the tools available for the current user first.

<ToolList tools={tools} />
5 changes: 5 additions & 0 deletions src/data/agent-connectors/catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1700,4 +1700,9 @@ export const catalog: Record<string, ProviderMeta> = {
authType: 'Bearer Token',
categories: ['Communication', 'Marketing', 'Developer Tools'],
},
facebookadsmcp: {
iconUrl: 'https://cdn.scalekit.com/sk-connect/assets/provider-icons/facebook.svg',
authType: 'OAuth2.1',
categories: ['Marketing', 'Analytics'],
},
}
Loading