Connect a module
Meta Ads (Facebook & Instagram)
ShopMCP connects to Meta Ads with OAuth first: authorize Meta, choose the ad accounts this workspace can use, read the Facebook Pages attached to those ad accounts, then optionally grant campaign-management scopes for write tools. The advanced System User token flow remains available for agencies that want durable per-client tokens.
OAuth is the recommended path
Use Connect with Meta from the integration page for the fastest setup. The manual steps below are still useful when an agency wants a dedicated, isolated System User token per client, or when OAuth is not configured in the current environment.
Why this path is safer than a generic ads agent
ShopMCP keeps Meta Ads read-only by default, scopes connections to the exact Ad Accounts you attach, hides write tools unless the workspace explicitly enables them, and records activity through ShopMCP's workspace controls and audit surfaces. The goal is operator-grade campaign access, not open-ended ad-account autonomy.
Fast path: OAuth
- Open Settings → Integrations → Meta Ads.
- Click
Connect with Metafor reporting plus campaign-management capability, orRead-onlyfor reporting only. - On Meta's consent screen, choose the Businesses, Pages, and Ad Accounts ShopMCP should access. For agencies, choose all accounts that may need to be assigned across client workspaces.
- Back in ShopMCP, select the exact ad accounts to attach. Each selected account becomes a separate connection so Claude and ChatGPT can route prompts by account without an ads dashboard.
What ShopMCP needs from you
You'll end up pasting three things into Settings → Integrations → Meta Ads:
- System User access token — a long-lived token generated by a System User you create inside Business Manager. Looks like a 200+ character string starting with
EAA…. - Business portfolio ID — the numeric ID of your Business in Business Manager (e.g.
1234567890123456). Sometimes still labelled “Business Manager ID” in older menus. - Ad Account ID (optional) — restricts ShopMCP to a single Ad Account, e.g.
act_1234567890. Leave blank to give ShopMCP every Ad Account the System User can see.
To produce a valid token, three things need to line up: a Business app at developers.facebook.com, that app added to your Business portfolio, and a System User in that Business with access to your Ad Accounts. Steps 1–6 walk through each. If you already have a Business App linked to your portfolio (most Shopify ↔ Meta installs and Conversions API setups create one), you can skip step 1.
Prerequisites
- Admin role on a Meta Business portfolio at business.facebook.com. Anything less can't create System Users or install apps.
- A verified Facebook account in good standing — the developer flow uses your personal Facebook identity to claim ownership of the App, even though the App itself runs on behalf of the Business.
1. Create a Business App at developers.facebook.com
Skip this step if Business Settings → Accounts → Apps inside Business Manager already lists an app you control. Otherwise:
- Open developers.facebook.com/apps/creation. If this is your first developer App, Meta walks you through a short developer-account registration first — agree to the policies, verify your Facebook account by phone or email, done.
- App details — give it a name (e.g.
Acme Marketing API) and a contact email. ClickNext. - Use cases — pick
Other. The use-case picker shortcuts add permissions for specific Meta products (Login, WhatsApp, etc.); for the Marketing API the cleanest path is to start blank and add the product manually. ClickNext. - App type — pick
Business. This is mandatory for Marketing API access;ConsumerandGamingcan't requestads_read. ClickNext. - Business portfolio — pick the same Business you'll be creating the System User in. This step matters. If the dropdown is empty, click
Create newand follow the prompt; you can also skip and link the Business later (step 2). ClickCreate app. - On the new app dashboard, scroll to
Add products to your app, find theMarketing APIcard, and clickSet up. No further configuration is needed — adding the product is what unlocksads_read/ads_managementin the System User token scope picker later. - (Optional) From the left nav, open
App settings → Basicand copy the App ID. You won't paste it into ShopMCP, but it's useful when troubleshooting which app a token belongs to.
2. Link the App to your Business portfolio
If the dropdown in step 1.5 had your Business in it and you picked it, the link is already done — skip ahead. Otherwise, the System User will not be able to generate a token for this App until you do this.
- Open business.facebook.com/settings/apps (path:
Business Settings → Accounts → Apps). - Click
Add→Connect an app ID. Paste the App ID from step 1.7 and clickAdd app. Meta confirms the link instantly.
3. Create a System User
Open business.facebook.com/settings/system-users (path: Settings → Users → System users; older guides call this “Business Settings → System Users”, same screen).
- Click
Add(in some accounts the button is labelledAdd new system user). - Type — if Meta asks, pick
Regular system user. The other option,Admin system user, is a separate concept — don't confuse it with the role picker on the next screen. - Name — Meta's profile-name policy rejects names with too many capital letters, so
ShopMCPandSHOPMCPboth fail. Use something mostly lowercase, e.g.ShopMCP integration,shopmcp reporting, or justReporting. - Role — choose
Adminif Meta allows it. Each Business is capped at one Admin System User, so if Meta refuses (“You already have an admin system user”), chooseEmployeeinstead. Employees work fine for ShopMCP — you just have to assign Ad Accounts explicitly in step 4. - Click
Create system user.
4. Assign Ad Account access
Required for Employee System Users. For Admin System Users this happens automatically for every Ad Account in the Business — but assigning explicitly anyway is good hygiene.
- With the System User selected, click
Add Assetsin the right-hand panel. - Pick
Ad Accountsin the asset-type sidebar. Tick every Ad Account ShopMCP should access. - Permissions — toggle on
View performanceat minimum. AddManage campaignsonly if you plan to enable ShopMCP's write tools later. Don't toggleManage Ad Account— ShopMCP doesn't need account-level admin. - Click
Save changes. The grant is effective immediately.
5. Generate the access token
Still on the System User detail page, click Generate new token.
- App— pick the App from steps 1–2. If it's not in the dropdown, the App isn't linked to this Business portfolio yet — go back and finish step 2.
- Token expiration — pick
Never. System User tokens are designed to persist; the 60-day option is there for compatibility with short-lived flows you don't need. - Available scopes — tick:
- ads_read — required for ad account, campaign, ad, creative, audience, catalog, pixel, and paid-insight tools.
- pages_read_engagement — required for scoped Facebook Page posts and organic engagement counts.
- pages_read_user_content — recommended for fuller organic Page activity reads, including Page-owned post content.
- read_insights — needed for Page Insights metrics when Meta/App Review makes it available for your app.
- ads_management— only if you'll enable write tools later. Skip otherwise; principle of least privilege.
- business_management — recommended. Lets ShopMCP enumerate Ad Accounts across multiple Businesses the token can see (matters for agencies and holding companies).
- Click
Generate token. - Copy the token now. Meta only shows the value once. If you close the dialog without copying, generate a new token; the old one stays valid until you click
Revokenext to it.
Validate the scopes Meta actually granted
Meta sometimes silently drops a scope if the App hasn't been approved for it via App Review. After generating, click Inspect token in the Graph API debugger (linked from the same panel) and confirm ads_read, pages_read_engagement, pages_read_user_content, read_insights, and any write scopes you requested are in the Scopes list. If any are missing, request access in App Review → Permissions and Features first, then regenerate the token.
6. Find your Business portfolio ID
Open business.facebook.com/settings/info (path: Settings → Business info). Copy the numeric Business portfolio ID shown at the top — 15-16 digits, e.g. 1234567890123456.
7. Find Ad Account IDs (optional)
Only needed if you want to scope ShopMCP to a single Ad Account. Open business.facebook.com/settings/ad-accounts and click an Ad Account in the list — its ID is shown directly under the name, prefixed with act_. Pass the value with the act_ prefix when you paste it into ShopMCP (e.g. act_1234567890).
8. Paste into ShopMCP
Open Settings → Integrations → Meta Ads. Fill in the System User access token (step 5), Business portfolio ID (step 6), and optionally an Ad Account ID (step 7). Click Connect Meta Ads.
On submit, ShopMCP calls GET /me on the Meta Graph API to confirm the token is valid. A successful verification persists the credentials encrypted at rest (KMS envelope) and flips the Meta Ads module to Connected for every API key in the workspace.
Write tools are off by default
ShopMCP's Meta Ads package includes write tools for campaign, ad set, ad, creative, image, audience, budget, status, and duplicate operations. They're compiled in but never registered until you flip the Allow writes toggle on the integration page — and the connected Meta token has ads_management in its scope. Catalog reads are available, but catalog write tools are deferred until Meta exposes a compatible reviewed permission path for this Business Login setup.
Each write tool is locked to a hand-written, field-level input allowlist. For example, meta_ads_update_campaign_budget accepts daily_budget and lifetime_budget — and nothing else. Unsupported fields are rejected at the input schema layer before any HTTP request is built. If a prompt injection convinces the LLM to call a write tool with disallowed fields, the Zod validator drops the request on the floor.
Facebook Page activity is scoped to the ad account
The Page tools do not read every Page your Facebook login can access. ShopMCP first asks Meta for the Pages available to the selected ad account, then only reads posts, engagement counts, and insights for those scoped Pages. If one ad account can promote multiple Pages, Claude or ChatGPT will ask you to choose a page_id or page_name.
Typical prompts include Show recent Facebook Page activity for BAA, List organic posts for Boat Accessories Australia, and Get Page insight metrics for the last 7 days.
Token lifecycle
System User access tokens never expire when you choose Never in step 5.2. Unlike short-lived User tokens, System User tokens are designed for server-to-server integrations and persist until manually revoked.
- Revoke a single token. On the System User page, find the token in the list and click
Revoke. The System User itself remains active — only that specific token stops working. - Revoke by deleting the System User. In Business Manager, go to
Settings → Users → System users, select the user, and clickRemove. All tokens issued to that System User are immediately invalidated. - Rotate periodically.Even though the token doesn't expire, generate a new one and revoke the old one every ~90 days as a security best practice.
Troubleshooting
- “Profile names can't have too many capital letters”— Meta's profile-name policy. Use a mostly-lowercase name like
ShopMCP integrationorReporting. - “You already have an admin system user” — each Business is capped at one Admin System User. Pick
Employeeinstead and assign Ad Accounts explicitly (step 4). - App dropdown is empty when generating the token— the App isn't linked to this Business portfolio. Go back to step 2 and use
Business Settings → Accounts → Apps → Add → Connect an app ID. - “Invalid OAuth access token” (401) on connect — the token has been revoked, the System User was deleted, or you pasted only part of the token. Regenerate and re-paste — Meta tokens are 200+ characters; truncated copies fail validation.
- “Permissions error” (403)— the token doesn't have the scope ShopMCP needs. Inspect it in the Graph API debugger and confirm the relevant scope is listed:
ads_readfor ad tools,pages_read_engagementandpages_read_user_contentfor Page posts, andread_insightsfor Page Insights. If missing, fix App Review access and regenerate. - “(#100) Tried accessing nonexisting field … on node type AdAccount” — the System User doesn't have
View performanceon that Ad Account. Go back to step 4 and tick the Ad Account. - “Application request limit reached” (429)— Meta is rate-limiting the App. ShopMCP doesn't auto-retry on 429. Wait a few minutes; if it keeps happening, check whether other integrations share the App and are eating the rate-limit budget.
- “OAuthException”— usually the App isn't approved for the requested permission, or it's still in development mode. Open it at developers.facebook.com/apps and confirm the relevant Marketing API permissions show
Standard AccessinApp Review → Permissions and Features.

