Meta Ads (Facebook/Instagram) MCP server for Claude, ChatGPT, Perplexity & Cursor — the Meta node of Pipeboard’s 5-platform family (+ Google, TikTok, Snap, Reddit). Hosted remote MCP, badged Meta Business Partner, free plan — no self-hosting required.
Python advertisingai-agentschatgptclaudefacebook-adsinstagram-adsmcpmeta-adsmodel-context-protocolpipeboard
Upgrade Meta Graph API from v22.0 to v24.0
Yves Junqueira911001fc47fc
diff --git a/meta_ads_mcp/core/adsets.py b/meta_ads_mcp/core/adsets.pyindex 3e96567..ad6bcea 100644--- a/meta_ads_mcp/core/adsets.py+++ b/meta_ads_mcp/core/adsets.py@@ -237,7 +237,7 @@ async def create_adset(if bid_strategy == 'LOWEST_COST':return json.dumps({"error": "'LOWEST_COST' is not a valid bid_strategy value",- "details": "The 'LOWEST_COST' bid strategy is not valid in Meta Ads API v22.0",+ "details": "The 'LOWEST_COST' bid strategy is not valid in Meta Ads API v24.0","workaround": "Use 'LOWEST_COST_WITHOUT_CAP' instead (no bid_amount required)","valid_values": ["LOWEST_COST_WITHOUT_CAP (recommended - no bid_amount required)",@@ -388,7 +388,7 @@ async def update_adset(adset_id: str, frequency_control_specs: Optional[List[Dicif bid_strategy == 'LOWEST_COST':return json.dumps({"error": "'LOWEST_COST' is not a valid bid_strategy value",- "details": "The 'LOWEST_COST' bid strategy is not valid in Meta Ads API v22.0",+ "details": "The 'LOWEST_COST' bid strategy is not valid in Meta Ads API v24.0","workaround": "Use 'LOWEST_COST_WITHOUT_CAP' instead (no bid_amount required)","valid_values": ["LOWEST_COST_WITHOUT_CAP (recommended - no bid_amount required)",diff --git a/meta_ads_mcp/core/api.py b/meta_ads_mcp/core/api.pyindex 816e51f..b5bbde8 100644--- a/meta_ads_mcp/core/api.py+++ b/meta_ads_mcp/core/api.py@@ -11,7 +11,7 @@ from .auth import needs_authentication, auth_manager, start_callback_server, shufrom .utils import logger# Constants-META_GRAPH_API_VERSION = "v22.0"+META_GRAPH_API_VERSION = "v24.0"META_GRAPH_API_BASE = f"https://graph.facebook.com/{META_GRAPH_API_VERSION}"USER_AGENT = "meta-ads-mcp/1.0"diff --git a/meta_ads_mcp/core/auth.py b/meta_ads_mcp/core/auth.pyindex 6602148..b8a8eb4 100644--- a/meta_ads_mcp/core/auth.py+++ b/meta_ads_mcp/core/auth.py@@ -226,7 +226,7 @@ class AuthManager:def get_auth_url(self) -> str:"""Generate the Facebook OAuth URL for desktop app flow"""return (- f"https://www.facebook.com/v22.0/dialog/oauth?"+ f"https://www.facebook.com/v24.0/dialog/oauth?"f"client_id={self.app_id}&"f"redirect_uri={self.redirect_uri}&"f"scope={AUTH_SCOPE}&"@@ -403,7 +403,7 @@ def exchange_token_for_long_lived(short_lived_token):return None# Make the API request to exchange the token- url = "https://graph.facebook.com/v22.0/oauth/access_token"+ url = "https://graph.facebook.com/v24.0/oauth/access_token"params = {"grant_type": "fb_exchange_token","client_id": app_id,diff --git a/meta_ads_mcp/core/pipeboard_auth.py b/meta_ads_mcp/core/pipeboard_auth.pyindex 754961e..fd1e26e 100644--- a/meta_ads_mcp/core/pipeboard_auth.py+++ b/meta_ads_mcp/core/pipeboard_auth.py@@ -448,7 +448,7 @@ class PipeboardAuthManager:try:# Make a simple request to the /me endpoint to test the token- META_GRAPH_API_VERSION = "v22.0"+ META_GRAPH_API_VERSION = "v24.0"url = f"https://graph.facebook.com/{META_GRAPH_API_VERSION}/me"headers = {"Authorization": f"Bearer {self.token_info.access_token}"}