MetorialDocs

Set up Meta Ads in Metorial for Claude, ChatGPT and Cursor

Share Meta Ads with your team in Claude, ChatGPT and Cursor through Metorial: OAuth or system user token sign-in, 34 tools (19 read-only).

To give your team Meta Ads in Claude, ChatGPT, Cursor and other AI clients, an admin shares the Meta Ads integration in a Metorial portal, and each person signs in to Meta Ads with their own account. Agents can create, manage, and optimize ad campaigns across Facebook, Instagram, Messenger, and WhatsApp. The integration has 34 tools, 19 read-only, 10 write and 5 destructive, plus 2 triggers.

What you'll learn

  • How an admin shares Meta Ads in a portal and how each person connects
  • The 6 OAuth scopes Meta Ads can request, and what each one allows
  • How to keep the 19 read-only tools and reject the other 15

Before you start

Sign-in methods

MethodTypeWhat a person provides
OAuth (default)OAuthSigns in to Meta Ads
System User TokenAPI tokenapiToken

The portal and metorial setup use OAuth unless someone picks another method.

OAuth

People sign in to Meta Ads and approve the scopes you allow. The integration can request:

ScopeNameWhat it allows
ads_managementAds ManagementCreate, edit, and delete campaigns, ad sets, and ads
ads_readAds ReadRead performance data, campaign details, and insights
business_managementBusiness ManagementManage business assets like ad accounts, pixels, and catalogs
pages_read_engagementPages Read EngagementRead content posted on Pages and engagement data
leads_retrievalLeads RetrievalRetrieve lead data submitted through lead ads
pages_manage_metadataPages Manage MetadataSubscribe apps to receive webhooks for Page events

System User Token

To connect, a person enters:

  • apiToken: System User access token generated from Business Manager. These tokens do not expire.

Setup settings

Whichever method you pick, setup also asks for:

  • adAccountId: Meta Ad Account ID (e.g., act_123456789). This is used as the default ad account for all operations.
  • businessId (optional): Optional Meta Business ID used by product catalog tools. You can also pass businessId directly to those tools.
  • apiVersion (optional): Graph API version to use (e.g., v25.0)

Use your own Meta Ads OAuth app

With your own OAuth app, people see your company's name on the Meta Ads consent screen, and the client ID and secret belong to you.

Start the credentials in Metorial

In the dashboard, select Settings, then Organization Settings. Under Integrations and MCP, select Provider Auth, then Create Auth Credentials. Choose Meta Ads and copy the Redirect URI.

Register the app with Meta Ads

Create an OAuth app or client in Meta Ads and add the redirect URI from Metorial as its redirect or callback URL.

Finish in Metorial

Copy the app's client ID and client secret. Back in Metorial, enter a Name, the Client ID and the Client Secret, review Scopes, and select Create. Then pick these credentials for the Meta Ads integration.

Admin: share Meta Ads in a portal

In the dashboard

Open Shared Resources

Open Workforce, choose the portal, and select Shared Resources under Access.

Share a new integration

Select Share a Resource, then New Integration, and choose Meta Ads. Under Auth Method, keep OAuth or pick another. For how members connect, choose Each person connects, so everyone signs in to Meta Ads as themselves.

Limit the tools

Under Tool Filters, set the write and destructive groups to Reject if agents should only read from Meta Ads.

Choose who gets it

Add the access groups that should see Meta Ads. When a person asks for access from the portal, the request appears under Access Requests.

With the CLI

The CLI cannot create the per-user Meta Ads integration. Once it exists, check which groups have it:

metorial-admin portals access list <portal-id> --type provider_template --search "meta ads"

Employee: connect Meta Ads

In the portal

Open Meta Ads in the catalog

Sign in to your portal and open Meta Ads. The status reads Available.

Authenticate

Under Quick setup, select Authenticate. A Meta Ads sign-in tab opens. Sign in and approve the permissions listed.

Confirm

The status changes to Configured. If it later reads Needs reconnect, select Reconnect and sign in again.

With the CLI

metorial catalog search "meta ads"
metorial setup <catalog-item-id>

catalog search prints the catalog item ID. metorial setup uses OAuth. To connect with System User Token instead, find its ID with metorial catalog get <catalog-item-id> and add --auth-method <auth-method-id>.

Add it to your AI client

metorial install adds your Meta Ads connection to a local MCP client such as Claude Code, Cursor or Codex. metorial list prints the integration ID and metorial client list the client identifiers.

metorial list "meta ads"
metorial client list
metorial install <client-identifier> <integration-id>

For a client that takes a server URL, such as ChatGPT, metorial install custom <integration-id> creates an installation token and shows the endpoint details.

Make it read-only

Open the integration's Tool Filters and set the write and destructive groups to Reject. Agents keep the 19 read-only tools, such as get_ad and list_ads, and lose the 10 write tools, such as create_ad or update_ad, and the 5 destructive tools, such as delete_ad or delete_ad_set.

Employees see the result on the integration's page in the portal under Tool access. For the full walkthrough, see Tool permissions.

Check it worked

metorial list "meta ads"
metorial tools <integration-id>
metorial call <integration-id> list_ads -d '{}'

metorial tools lists the 34 tools, minus any you rejected. list_ads takes no input. It retrieves ads from the ad account or a specific ad set.

To see every input a tool takes, run metorial schema <integration-id> <tool-key>.

Tools

Read-only tools (19)

  • get_ad: Retrieve detailed information about a specific ad by its ID. Needs adId.
  • list_campaigns: Retrieve campaigns from the configured ad account.
  • search_ad_library: Search Meta's public Ad Library for ads running across Facebook, Instagram, Messenger, and WhatsApp. Needs adReachedCountries.
  • get_custom_audience: Retrieve detailed information about a specific custom audience. Needs audienceId.
  • get_leads: Retrieve submitted lead data from a lead generation form. Needs formId.
  • list_custom_audiences: Retrieve custom audiences from the ad account.
  • list_ad_sets: Retrieve ad sets from the ad account or a specific campaign.
  • get_insights: Query performance metrics (impressions, clicks, spend, conversions, ROAS, etc.) at account, campaign, ad set, or ad level.
  • get_campaign: Retrieve detailed information about a specific campaign by its ID. Needs campaignId.
  • list_ads: Retrieve ads from the ad account or a specific ad set.
  • list_lead_forms: Retrieve lead generation forms from a Facebook Page. Needs pageId.
  • get_ad_set: Retrieve detailed information about a specific ad set including its targeting configuration. Needs adSetId.
  • get_ad_creative: Retrieve detailed information about a specific ad creative. Needs creativeId.
  • list_ad_creatives: Retrieve ad creatives from the ad account.
  • list_pages: List Facebook Pages available to the authenticated user.
  • list_product_catalogs: List product catalogs owned by a Meta Business.
  • list_ad_accounts: List ad accounts visible to the authenticated user.
  • list_businesses: List Meta Business accounts available to the authenticated user.
  • list_catalog_products: List products in a Meta product catalog, with optional catalog API filter support. Needs catalogId.

Write tools (10)

  • update_campaign: Update an existing campaign's settings including name, status, budget, and bid strategy. Needs campaignId.
  • create_ad_creative: Create a new ad creative. Needs name and objectStorySpec.
  • create_custom_audience: Create a new custom audience. Needs name.
  • update_ad: Update an existing ad's name, status, or creative. Needs adId.
  • add_users_to_audience: Add users to an existing custom audience using hashed identifiers. Needs audienceId, schema and userData.
  • create_ad_set: Create a new ad set within a campaign. Needs name, campaignId, targeting and optimizationGoal.
  • update_ad_set: Update an existing ad set's settings including targeting, budget, schedule, and status. Needs adSetId.
  • create_ad: Create a new ad within an ad set. Needs name, adSetId and creativeId.
  • create_campaign: Create a new advertising campaign. Needs name and objective.
  • send_conversion_events: Send server-side conversion events via the Conversions API. Needs datasetId and events.

Destructive tools (5)

  • delete_ad: Delete an ad. Needs adId.
  • delete_custom_audience: Delete a custom audience. Needs audienceId.
  • delete_ad_set: Delete an ad set. Needs adSetId.
  • delete_campaign: Delete a campaign. Needs campaignId.
  • remove_users_from_audience: Remove users from an existing custom audience using the same SHA-256 hashed identifier schema used for uploads. Needs audienceId, schema and userData.

Triggers

Meta Ads has 2 triggers, which fire on events in Meta Ads:

  • ad_account_changes: Receives webhook notifications when campaigns, ad sets, or ads change status (e.g., approved, rejected, delivery issues).
  • lead_submitted: Receives webhook notifications when a new lead is submitted through a lead ad form.

Next steps