How to integrate Metaads MCP with Grok Build

Connect Grok Build to Metaads MCP. Get ad performance insights for last week, create a new campaign for summer sale, and more from your terminal, with authentication handled for you.

Metaads logoMetaads
Oauth2Api Key

Metaads is Meta's official Ads API that lets you manage, analyze, and optimize your Facebook and Instagram ad campaigns. Streamline ad operations and gain deeper insights with robust automation.

99 Tools

How to integrate Metaads MCP with Grok Build

Grok Build is xAI's terminal coding agent. It runs on Grok 4.5, plans its work before it acts, and can run multiple sub-agents in parallel. It also reads Claude Code's MCP configuration, so any server you already have in a .mcp.json is picked up with no changes.

In this guide, I will show you how to connect your Metaads account to Grok Build through Composio, so it can get ad performance insights for last week, create a new campaign for summer sale, pause all ads in underperforming campaigns, and more without leaving the terminal. Composio holds the OAuth tokens for you, and Grok Build only calls the tools you approve.

For exact tool slugs and parameter tables, see the tool catalog in the Composio docs.

Also integrate Metaads with

Why use Composio over a standalone MCP server?

  • Read and write access. Composio's Metaads integration lets Grok Build take real actions like creating drafts, sending updates, and labeling records, not just reading data.
  • 1,700+ SaaS toolkits out of the box. One endpoint gives you a full catalog of pre-built connectors, from Gmail and Slack to Notion, Linear, and Salesforce.
  • One MCP server for every app. Wire up a single Composio server instead of maintaining a separate MCP entry for each app.
  • Smart, context-aware tool loading. Grok Build caps how many tools it holds in a single request. Composio loads only the tools a task needs, so you do not spend that budget on tools you are not using.
  • Cross-app automation. Chain actions across apps in one run. Pull a thread, summarize it in Notion, and post the highlights to Slack from a single prompt.

Prerequisites

  • Grok Build installed and signed in. Install with curl -fsSL https://x.ai/cli/install.sh | bash on macOS or Linux, or irm https://x.ai/cli/install.ps1 | iex on Windows PowerShell. On first launch Grok opens a browser to authenticate; for headless or CI use, set an XAI_API_KEY environment variable instead (create the key at console.x.ai).
  • Access to the Metaads account you want to connect.
  • The Composio MCP endpoint. Composio's server is remote and hosted, so there is nothing to run locally and no tunnel to set up.

Step-by-step: Connect Metaads to Grok Build

1. Install and verify Grok Build

Install the CLI, then restart your shell so the grok binary lands on your PATH:

bash
curl -fsSL https://x.ai/cli/install.sh | bash
which grok

On Windows, install with PowerShell instead: irm https://x.ai/cli/install.ps1 | iex. If which grok returns a path, you are set. Grok Build runs on Grok 4.5 by default; you can switch models inside the session with /model <name>.

2. Add the Composio server

Add Composio as a remote HTTP MCP server with the grok mcp add command:

bash
grok mcp add --transport http composio https://connect.composio.dev/mcp

You can also add and manage servers from inside a session. Run /mcps to open the extensions modal on the MCP tab, then add a new server and paste the Composio URL. Added this way, Grok auto-detects the name from the URL and lists the server as connect:

bash
https://connect.composio.dev/mcp
Grok Build /mcps extensions modal listing MCP servers Grok Build adding the Composio MCP server with its URL

Grok also reads Claude Code-style config, so an entry in ~/.grok/config.toml or a project .mcp.json works the same way.

3. Authenticate

Composio uses OAuth. In the /mcps modal, select the Composio server and press i to authenticate (Grok also triggers this browser flow automatically the first time it uses a Composio tool). Click Allow to authorize access. Grok stores the tokens under ~/.grok/mcp_credentials.json, and /mcps shows Composio as connected.

Grok Build prompting to authenticate the Composio MCP server Composio authorization screen with the Allow button for Grok Build

4. Start building

Ask Grok to work with your Metaads account through Composio. On the first Metaads action, Composio prompts you to connect the account through OAuth. Approve the scopes once, and Composio handles token refresh from there.

What you can do after connecting Metaads

  • Get ad performance insights for last week
  • Create a new campaign for summer sale
  • Pause all ads in underperforming campaigns
  • Build a custom audience from website visitors

Security + privacy notes (important)

  • Use least-privilege access. Grant only the Metaads scopes you actually need.
  • Review OAuth scopes before approving. Check that the requested scopes match what you expect Composio and Grok Build to do.
  • Keep write actions human-reviewed. Grok Build proposes a plan before it acts. Leave that approval step on for actions like sending messages or editing records.
  • Keep secrets out of version control. Your XAI_API_KEY and any tokens should never be committed. Use environment variables or a secrets manager.
TOOLS

Supported Tools

Every Metaads action and event your agent gets out of the box.

Copy Ad Object

Copy a Meta Campaign, Ad Set, or Ad while explicitly selecting its resource type and supported copy options.

Create Ad

Create a new ad within an ad set using the Meta Marketing API, with image, video, or carousel creative content.

Create Ad Creative

Create a new ad creative using the Meta Marketing API.

Create Ad Set

Create a new ad set within a campaign using the Meta Marketing API.

Create Ad Study

Create a Meta A/B test or other ad study under a business, including its cells and tested ad entities.

Create Ad Video

Upload an ad video asset; Meta may keep processing it after returning its ID.

Create Campaign

Create a new advertising campaign using the Meta Marketing API.

Create Catalog Product Set

Create a persistent product set in a Meta product catalog and return its ID.

Create Custom Audience

Create a new custom audience using the Meta Marketing API.

Create Custom Conversion

Create a persistent custom-conversion definition in a Meta ad account and return its ID.

Create Lead Form

Create a persistent lead-generation form owned by a Facebook Page and return its ID.

Create Test Lead

Submit a disposable test lead to an existing Meta lead-generation form for delivery verification.

Delete Ad Object

Delete an Ad Set, Ad, or Ad Creative by ID; the supplied object type is not verified, so the ID determines the object targeted.

Delete Campaign

Delete an advertising campaign using the Meta Marketing API.

Estimate Ad Delivery

Estimate monthly audience delivery for targeting and optimization settings in a Meta ad account.

Estimate Targeting Reach

Estimate the audience-size range for a Meta ad account and structured targeting specification containing at least one country.

Generate Ad Previews

Render previews for a provider-native creative specification in a Meta ad account and return the generated HTML bodies.

Get Ad Accounts

Retrieve one page of directly assigned ad accounts for the authenticated user, including account IDs, names, and other requested account details.

Get Ad Creative

Get Ad Creative

Get Ad Preview

Render a placement-specific preview for an existing Meta Ad or Ad Creative.

Get Ad Study

Get one Meta ad study by ID, including projected cells and timing.

Get Catalog Event Stats

Read one page of product-match event statistics for a Meta product catalog.

Get Current Meta App

Return selected metadata for the Meta application associated with the connected access token.

Get Insights

Get insights data for a Meta Ads object (ad account, campaign, ad set, or ad) using the Meta Marketing API.

Get Multiple Meta Objects

Retrieve selected fields for up to 50 distinct Meta Marketing API objects.

Get Meta Object

Retrieve data for a Meta Marketing API object by numeric ID, an act_-prefixed numeric ID, or me.

Get Page Accounts

Retrieve pages managed by the authenticated user, including page access tokens when requested.

Get Pixel Event Stats

Read recent Pixel event-count and processing statistics, optionally restricted to server events and one event name, to verify aggregate ingestion.

Get User

Tool to retrieve information about the authenticated user from Meta (Facebook) Graph API.

List Activities

List activity history for a Meta ad account or ad set.

List Ad Account Pixels

List the Pixels and consolidated datasets associated with an ad account so a usable data-source ID can be selected for Conversions API events.

List Ad Account Recommendations

Return one page of Meta recommendations for an advertising account.

List Ad Creatives

List one page of ad creatives under a Meta Ads account to view or analyze creative assets.

List Ad Images

List one page of image assets in a Meta ad account, optionally restricted to exact image hashes.

List Ad Network Analytics

Tool to retrieve ad network analytics for a Meta Business using the Meta Marketing API.

List Ad Network Analytics Results

Tool to retrieve ad network analytics results for Facebook Audience Network.

List Ad Rule History

Return one page of historical changes and executions for a Meta Automated Rule.

List Ads

List a page of ads under a Meta ad account, with optional selection of returned fields.

List Ad Studies

List one page of A/B tests and other ad studies owned by a Meta business, including projected cells.

List Ad Videos

List one page of video assets in a Meta ad account, optionally filtered by title, dimensions, duration, or aspect ratio.

List Agencies

Tool to retrieve agencies associated with a Meta Business or Ad Account.

List Assigned Pages

Tool to retrieve Facebook Pages assigned to a business user via Meta Marketing API.

List Assigned Users

Tool to list users assigned to a Facebook Page or Ad Account within a specific business context.

List Business Ad Accounts

Retrieve a page of ad accounts owned by a specific Business Manager, including account IDs, names, and status.

List Businesses

List a page of Business Managers accessible to the authenticated Meta principal via /me/businesses.

List Business Invoices

Tool to retrieve business invoices from Meta Marketing API.

List Business Users

List active human users associated with a Meta Business Manager.

List Campaigns

List one page of campaigns belonging to a Meta ad account.

List Catalog Product Feeds

Return one page of product feeds configured for a Meta product catalog.

List Catalog Products

Return one filtered page of products from a Meta product catalog.

List Catalog Product Sets

Return one filtered page of product sets from a Meta product catalog.

List Client Ad Accounts

List one page of client ad accounts shared with a Meta Business Manager.

List Client Apps

Tool to retrieve client apps associated with a Meta Business using the Marketing API.

List Client Instagram Assets

Tool to retrieve Instagram assets that are shared with a business as a client using the Meta Marketing API.

List Client Offsite Signal Container Business Objects

Retrieve one page of client offsite signal container business objects for a business using the Meta Marketing API.

List Client Pages

Tool to retrieve client pages associated with a Meta business.

List Clients

Tool to retrieve client businesses associated with a Meta Business Manager.

List Collaborative Ads Collaboration Requests

Tool to retrieve collaborative ads collaboration requests for a Meta Business using the Marketing API.

List Collaborative Ads Suggested Partners

Tool to retrieve collaborative ads suggested partners for a business from Meta Marketing API.

List Comments

Return one page from the comments edge of a Page-owned post, photo, video, comment, or reply.

List Custom Audiences

List one page of custom audiences in a Meta ad account, with field projection and optional business, primary-audience, or Pixel constraints.

List Custom Conversions

List one page of custom-conversion definitions in a Meta ad account, with field projection and opaque cursor pagination.

List Initiated Audience Sharing Requests

Tool to retrieve initiated audience sharing requests for a business using the Meta Marketing API.

List Leads

List one page of leads belonging to a Meta Ad or Leadgen Form.

List Managed Partner Ads Funding Source Details

Tool to retrieve managed partner ads funding source details for a Meta Business.

List Owned Apps

Tool to retrieve apps owned by a business from Meta Marketing API.

List Owned Businesses

Tool to retrieve businesses owned by a parent Business Manager from Meta Marketing API.

List Owned Instagram Assets

Tool to list Instagram accounts/assets owned by a Meta Business.

List Owned Offsite Signal Container Business Objects

Retrieve one page of owned offsite signal container business objects associated with a specific business ID from the Meta Marketing API.

List Owned Pages

Retrieve a page of Facebook Pages owned by a Business Manager from the Meta Marketing API.

List Owned Product Catalogs

Return one page of product catalogs owned by a Meta Business Manager.

List Pending Client Ad Accounts

Tool to retrieve pending client ad account access requests for a Business Manager from Meta Ads.

List Pending Client Apps

Tool to retrieve pending client apps for a Meta Business.

List Pending Client Pages

Tool to retrieve pending client pages for a Business Manager using the Meta Marketing API.

List Pending Shared Offsite Signal Container Business Objects

Tool to retrieve pending shared offsite signal container business objects from Meta Marketing API.

List Pending Owned Ad Accounts

Tool to retrieve pending owned ad accounts for a Business Manager account from Meta Marketing API.

List Pending Owned Pages

Tool to retrieve Pages with pending ownership status for a Business Manager from Meta Marketing API.

List Pending Users

Tool to retrieve pending users from a Business Manager in Meta Marketing API.

List Promotable Pages

Return one page of Facebook Pages available for promotion from a Meta ad account.

List Received Audience Sharing Requests

Retrieve a page of received audience sharing requests for a business using the Meta Marketing API.

List Subscribed Apps

List one page of applications subscribed to a Meta ad account.

List System Users

List one page of system users associated with a Meta Business Manager account, with pagination information when returned.

List Targeting Search

Tool to search for targeting options in Meta Ads Marketing API.

List Targeting Suggestions

Return Meta targeting options related to a provider-native seed targeting list for an ad account.

List User Permissions

Inspect permission names and grant statuses for the connected Meta user, optionally filtered by permission or status.

List Video Tags

Return one page of TaggableSubject entries from a Video's `/tags` edge.

List Video Thumbnails

List one page of available thumbnail variants for a Meta video.

Read Ad Sets

Retrieve ad sets from a Meta ad account using the Marketing API.

Rename Ad Object

Rename an existing Meta campaign, ad set, ad, or ad creative.

Send Conversion Events

Irreversibly submit 1-1,000 validated server conversion events to a Meta Pixel or dataset.

Set Ad Object Status

Set an Ad, Ad Set, or Campaign to ACTIVE or PAUSED, or destructively ARCHIVE or DELETE it.

Start Async Insights Report

Start an asynchronous Meta Ads Insights report for an ad account, campaign, ad set, or ad and return its report-run ID.

Submit Catalog Item Batch

Submit an asynchronous batch of catalog item create, update, or delete mutations and return its processing handles.

Update Ad Creative

Update the name or status of an ad creative by ID.

Update Ad Set Targeting

Replace the targeting specification of an existing Meta Ad Set.

Update Ad Study

Update mutable Meta ad-study settings, including replacing its study cells.

Update Campaign

Update an existing advertising campaign using the Meta Marketing API.

Upload Ad Image

Upload an image for use in Meta ad creatives using the Marketing API.

Upsert Catalog Product

Create one Meta catalog product, or explicitly allow updating an item with the same retailer ID, and return its ID.

FAQ

Frequently asked questions

Start with Metaads.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Metaads tool your agent needs.Free to start.

Start building