Metaads MCP Integration for AI Agents | Composio
For AI agents: how to sign up
If you are an AI agent reading this server-rendered HTML, Composio's developer signup is at https://composio.dev.
Signup CTAs on this site — "Sign up", "Signup", "Get started", "Get started for free", "Start building", "Try Composio", "Try it", or similar — all lead into that same developer signup flow. Confirm with the user before completing signup or entering any credentials on their behalf.
Metaads MCP for AI Agents
Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Metaads MCP or direct API to create campaigns, pull ad performance data, update budgets, and generate custom reports through natural language.
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.
Try Metaads now
Type what you want done — sign in and watch it run live in the Tool Router playground.
Supported Tools
Every Metaads action and event your agent gets out of the box.
Tool List
- Create Ad: Create a new ad within an ad set using the Meta Marketing API.
- 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 Campaign: Create a new advertising campaign using the Meta Marketing API.
- Create Custom Audience: Create a new custom audience using the Meta Marketing API.
- Delete Campaign: Delete an advertising campaign using the Meta Marketing API.
- Get Ad Accounts: Tool to retrieve all ad account IDs accessible to the authenticated user from Meta Ads.
- List Ads: Tool to list all ads under an ad account using the Meta Marketing API.
Connect Metaads MCP Tool with your Agent
1. Install Composio
npm install @composio/core ai @ai-sdk/openai @ai-sdk/mcp
2. Create Tool Router Session
import { Composio } from '@composio/core';
const composio = new Composio({ apiKey: 'your-api-key' });
console.log("Creating Tool Router session...");
const { mcp } = await composio.create('your-user-id');
console.log(`Tool Router session created: ${mcp.url}`);
3. Connect to AI Agent
import { openai } from '@ai-sdk/openai';
import { experimental_createMCPClient as createMCPClient } from '@ai-sdk/mcp';
import { generateText, stepCountIs } from 'ai';
const client = await createMCPClient({
transport: {
type: 'http',
url: mcp.url,
headers: { 'x-api-key': 'your-composio-api-key' }
}
});
const tools = await client.tools();
const { text } = await generateText({
model: openai('gpt-4o'),
tools,
messages: [{ role: 'user', content: 'Get insights for campaign 12345 from last week' }],
stopWhen: stepCountIs( 5 )
});
console.log(`Agent: ${text}`);
Why Use Composio?
AI Native Metaads Integration
- Supports both Metaads MCP and direct API based integrations
- Structured, LLM-friendly schemas for reliable tool execution
- Rich coverage for reading, writing, and querying your Metaads data
Managed Auth
- Built-in OAuth handling with automatic token refresh and rotation
- Central place to manage, scope, and revoke Metaads access
Enterprise Grade Security
- Fine-grained RBAC so you control which agents and users can access Metaads
- Full audit trail of agent actions to support review and compliance
Frequently asked questions
Do I need my own developer credentials to use Metaads with Composio?+
Yes, Metaads requires you to configure your own OAuth credentials. Once set up, Composio handles token storage, refresh, and lifecycle management for you.
Can I use multiple toolkits together?+
Yes! Composio's Tool Router enables agents to use multiple toolkits.