
meta mcp
用于通过 Meta Client Platform 与 Facebook 营销 API 交互的工具包。
Repository Info
About This Server
用于通过 Meta Client Platform 与 Facebook 营销 API 交互的工具包。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Facebook Marketing API Client for Meta Client Platform (MCP)
This package provides tools for interacting with the Facebook Marketing API through the Meta Client Platform.
Important Update
As of version 2.0.0: All request payloads must use snake_case format as they are passed directly to the Facebook Marketing API without transformation. Previous versions used camelCase with automatic conversion.
The server now acts as a direct proxy to the Facebook Marketing API, passing all parameters through without modification and returning Facebook API responses directly.
Installation
npm install meta-mcp
Configuration
Set the following environment variables:
FB_ACCESS_TOKEN=your_facebook_access_token
FB_AD_ACCOUNT_ID=your_ad_account_id
FB_API_VERSION=v22.0
FB_API_DOMAIN=https://graph.facebook.com
Usage Examples
Creating a Campaign
const result = await callTool({
name: "createCampaign",
arguments: {
config: {
name: "Test Campaign",
objective: "OUTCOME_AWARENESS",
status: "PAUSED",
special_ad_categories: ["NONE"],
daily_budget: 2000, // $20.00
bid_strategy: "LOWEST_COST_WITHOUT_CAP"
}
}
});
Updating a Campaign
const result = await callTool({
name: "updateCampaign",
arguments: {
campaignId: "23848238482384",
config: {
name: "Updated Campaign Name",
daily_budget: 5000 // $50.00
}
}
});
Creating an Ad Set
const result = await callTool({
name: "createAdSet",
arguments: {
config: {
name: "My First Ad Set",
campaign_id: "23848238482384",
daily_budget: 1000, // $10.00
billing_event: "IMPRESSIONS",
optimization_goal: "REACH",
bid_strategy: "LOWEST_COST_WITHOUT_CAP",
targeting: {
geo_locations: {
countries: ["US"]
},
age_min: 18,
age_max: 65,
genders: [1, 2]
},
status: "PAUSED"
}
}
});
Creating an Ad
const result = await callTool({
name: "createAd",
arguments: {
config: {
name: "My First Ad",
adset_id: "23848238482384",
status: "PAUSED",
creative: {
name: "My First Creative",
title: "Try our amazing product!",
body: "This is the best product you'll ever use.",
link_url: "https://example.com",
image_url: "https://example.com/image.jpg",
call_to_action: "LEARN_MORE"
}
}
}
});
Getting Campaigns
const result = await callTool({
name: "getCampaigns",
arguments: {
limit: 10,
status: "ACTIVE",
datePreset: "last_30_days"
}
});
Getting Ad Sets
const result = await callTool({
name: "getAdSets",
arguments: {
campaignId: "23848238482384"
}
});
Getting Ads
const result = await callTool({
name: "getAds",
arguments: {
adSetId: "23848238482384"
}
});
Pausing a Campaign
const result = await callTool({
name: "pauseCampaign",
arguments: {
campaignId: "23848238482384"
}
});
Available Tools
Campaign Management
createCampaign: Create a new campaignupdateCampaign: Update an existing campaigngetCampaign: Get details for a specific campaigngetCampaigns: Get a list of campaignspauseCampaign: Pause an active campaign
Ad Set Management
createAdSet: Create a new ad setupdateAdSet: Update an existing ad setgetAdSet: Get details for a specific ad setgetAdSets: Get a list of ad sets for a campaigngetAccountAdSets: Get a list of ad sets for the accountpauseAdSet: Pause an active ad set
Ad Management
createAd: Create a new adupdateAd: Update an existing adgetAd: Get details for a specific adgetAds: Get a list of ads for an ad setgetAccountAds: Get a list of ads for the accountpauseAd: Pause an active ad
Account Management
getAvailableAdAccounts: Get a list of available ad accounts
Facebook API Parameters
Refer to the Facebook Marketing API documentation for details on available parameters and their formats. As the server now acts as a direct proxy, you can use any parameter documented in the Facebook Marketing API directly in your requests.
Error Handling
Errors from the Facebook API are passed directly to the client without modification. Check the error message and details for information about what went wrong.
License
MIT
Quick Start
Clone the repository
git clone https://github.com/hafidsousa/meta-mcpInstall dependencies
cd meta-mcp
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.