meta-ads-mcp 0.11.1__py3-none-any.whl → 0.11.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- meta_ads_mcp/__init__.py +1 -1
- meta_ads_mcp/core/ads.py +4 -0
- meta_ads_mcp/core/adsets.py +16 -5
- {meta_ads_mcp-0.11.1.dist-info → meta_ads_mcp-0.11.3.dist-info}/METADATA +18 -18
- {meta_ads_mcp-0.11.1.dist-info → meta_ads_mcp-0.11.3.dist-info}/RECORD +8 -8
- {meta_ads_mcp-0.11.1.dist-info → meta_ads_mcp-0.11.3.dist-info}/WHEEL +0 -0
- {meta_ads_mcp-0.11.1.dist-info → meta_ads_mcp-0.11.3.dist-info}/entry_points.txt +0 -0
- {meta_ads_mcp-0.11.1.dist-info → meta_ads_mcp-0.11.3.dist-info}/licenses/LICENSE +0 -0
meta_ads_mcp/__init__.py
CHANGED
meta_ads_mcp/core/ads.py
CHANGED
|
@@ -111,6 +111,10 @@ async def create_ad(
|
|
|
111
111
|
tracking_specs: Optional tracking specifications (e.g., for pixel events).
|
|
112
112
|
Example: [{"action.type":"offsite_conversion","fb_pixel":["YOUR_PIXEL_ID"]}]
|
|
113
113
|
access_token: Meta API access token (optional - will use cached token if not provided)
|
|
114
|
+
|
|
115
|
+
Note:
|
|
116
|
+
Dynamic Creative creatives require the parent ad set to have `is_dynamic_creative=true`.
|
|
117
|
+
Otherwise, ad creation will fail with error_subcode 1885998.
|
|
114
118
|
"""
|
|
115
119
|
# Check required parameters
|
|
116
120
|
if not account_id:
|
meta_ads_mcp/core/adsets.py
CHANGED
|
@@ -27,14 +27,14 @@ async def get_adsets(account_id: str, access_token: Optional[str] = None, limit:
|
|
|
27
27
|
if campaign_id:
|
|
28
28
|
endpoint = f"{campaign_id}/adsets"
|
|
29
29
|
params = {
|
|
30
|
-
"fields": "id,name,campaign_id,status,daily_budget,lifetime_budget,targeting,bid_amount,bid_strategy,optimization_goal,billing_event,start_time,end_time,created_time,updated_time,frequency_control_specs{event,interval_days,max_frequency}",
|
|
30
|
+
"fields": "id,name,campaign_id,status,daily_budget,lifetime_budget,targeting,bid_amount,bid_strategy,optimization_goal,billing_event,start_time,end_time,created_time,updated_time,is_dynamic_creative,frequency_control_specs{event,interval_days,max_frequency}",
|
|
31
31
|
"limit": limit
|
|
32
32
|
}
|
|
33
33
|
else:
|
|
34
34
|
# Use account endpoint if no campaign_id is given
|
|
35
35
|
endpoint = f"{account_id}/adsets"
|
|
36
36
|
params = {
|
|
37
|
-
"fields": "id,name,campaign_id,status,daily_budget,lifetime_budget,targeting,bid_amount,bid_strategy,optimization_goal,billing_event,start_time,end_time,created_time,updated_time,frequency_control_specs{event,interval_days,max_frequency}",
|
|
37
|
+
"fields": "id,name,campaign_id,status,daily_budget,lifetime_budget,targeting,bid_amount,bid_strategy,optimization_goal,billing_event,start_time,end_time,created_time,updated_time,is_dynamic_creative,frequency_control_specs{event,interval_days,max_frequency}",
|
|
38
38
|
"limit": limit
|
|
39
39
|
}
|
|
40
40
|
# Note: Removed the attempt to add campaign_id to params for the account endpoint case,
|
|
@@ -67,7 +67,7 @@ async def get_adset_details(adset_id: str, access_token: Optional[str] = None) -
|
|
|
67
67
|
endpoint = f"{adset_id}"
|
|
68
68
|
# Explicitly prioritize frequency_control_specs in the fields request
|
|
69
69
|
params = {
|
|
70
|
-
"fields": "id,name,campaign_id,status,frequency_control_specs{event,interval_days,max_frequency},daily_budget,lifetime_budget,targeting,bid_amount,bid_strategy,optimization_goal,billing_event,start_time,end_time,created_time,updated_time,attribution_spec,destination_type,promoted_object,pacing_type,budget_remaining,dsa_beneficiary"
|
|
70
|
+
"fields": "id,name,campaign_id,status,frequency_control_specs{event,interval_days,max_frequency},daily_budget,lifetime_budget,targeting,bid_amount,bid_strategy,optimization_goal,billing_event,start_time,end_time,created_time,updated_time,attribution_spec,destination_type,promoted_object,pacing_type,budget_remaining,dsa_beneficiary,is_dynamic_creative"
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
data = await make_api_request(endpoint, access_token, params)
|
|
@@ -100,6 +100,7 @@ async def create_adset(
|
|
|
100
100
|
dsa_beneficiary: Optional[str] = None,
|
|
101
101
|
promoted_object: Optional[Dict[str, Any]] = None,
|
|
102
102
|
destination_type: Optional[str] = None,
|
|
103
|
+
is_dynamic_creative: Optional[bool] = None,
|
|
103
104
|
access_token: Optional[str] = None
|
|
104
105
|
) -> str:
|
|
105
106
|
"""
|
|
@@ -125,8 +126,9 @@ async def create_adset(
|
|
|
125
126
|
Optional fields: custom_event_type, pixel_id, page_id.
|
|
126
127
|
Example: {"application_id": "123456789012345", "object_store_url": "https://apps.apple.com/app/id123456789"}
|
|
127
128
|
destination_type: Where users are directed after clicking the ad (e.g., 'APP_STORE', 'DEEPLINK', 'APP_INSTALL', 'ON_AD').
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
Required for mobile app campaigns and lead generation campaigns.
|
|
130
|
+
Use 'ON_AD' for lead generation campaigns where user interaction happens within the ad.
|
|
131
|
+
is_dynamic_creative: Enable Dynamic Creative for this ad set (required when using dynamic creatives with asset_feed_spec/dynamic_creative_spec).
|
|
130
132
|
access_token: Meta API access token (optional - will use cached token if not provided)
|
|
131
133
|
"""
|
|
132
134
|
# Check required parameters
|
|
@@ -249,6 +251,10 @@ async def create_adset(
|
|
|
249
251
|
if destination_type:
|
|
250
252
|
params["destination_type"] = destination_type
|
|
251
253
|
|
|
254
|
+
# Enable Dynamic Creative if requested
|
|
255
|
+
if is_dynamic_creative is not None:
|
|
256
|
+
params["is_dynamic_creative"] = "true" if bool(is_dynamic_creative) else "false"
|
|
257
|
+
|
|
252
258
|
try:
|
|
253
259
|
data = await make_api_request(endpoint, access_token, params, method="POST")
|
|
254
260
|
return json.dumps(data, indent=2)
|
|
@@ -290,6 +296,7 @@ async def create_adset(
|
|
|
290
296
|
async def update_adset(adset_id: str, frequency_control_specs: Optional[List[Dict[str, Any]]] = None, bid_strategy: Optional[str] = None,
|
|
291
297
|
bid_amount: Optional[int] = None, status: Optional[str] = None, targeting: Optional[Dict[str, Any]] = None,
|
|
292
298
|
optimization_goal: Optional[str] = None, daily_budget: Optional[int] = None, lifetime_budget: Optional[int] = None,
|
|
299
|
+
is_dynamic_creative: Optional[bool] = None,
|
|
293
300
|
access_token: Optional[str] = None) -> str:
|
|
294
301
|
"""
|
|
295
302
|
Update an ad set with new settings including frequency caps and budgets.
|
|
@@ -306,6 +313,7 @@ async def update_adset(adset_id: str, frequency_control_specs: Optional[List[Dic
|
|
|
306
313
|
optimization_goal: Conversion optimization goal (e.g., 'LINK_CLICKS', 'CONVERSIONS', 'APP_INSTALLS', etc.)
|
|
307
314
|
daily_budget: Daily budget in account currency (in cents) as a string
|
|
308
315
|
lifetime_budget: Lifetime budget in account currency (in cents) as a string
|
|
316
|
+
is_dynamic_creative: Enable/disable Dynamic Creative for this ad set.
|
|
309
317
|
access_token: Meta API access token (optional - will use cached token if not provided)
|
|
310
318
|
"""
|
|
311
319
|
if not adset_id:
|
|
@@ -342,6 +350,9 @@ async def update_adset(adset_id: str, frequency_control_specs: Optional[List[Dic
|
|
|
342
350
|
if lifetime_budget is not None:
|
|
343
351
|
params['lifetime_budget'] = str(lifetime_budget)
|
|
344
352
|
|
|
353
|
+
if is_dynamic_creative is not None:
|
|
354
|
+
params['is_dynamic_creative'] = "true" if bool(is_dynamic_creative) else "false"
|
|
355
|
+
|
|
345
356
|
if not params:
|
|
346
357
|
return json.dumps({"error": "No update parameters provided"}, indent=2)
|
|
347
358
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: meta-ads-mcp
|
|
3
|
-
Version: 0.11.
|
|
3
|
+
Version: 0.11.3
|
|
4
4
|
Summary: Model Context Protocol (MCP) server for interacting with Meta Ads API
|
|
5
5
|
Project-URL: Homepage, https://github.com/pipeboard-co/meta-ads-mcp
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/pipeboard-co/meta-ads-mcp/issues
|
|
@@ -13,7 +13,7 @@ Classifier: Operating System :: OS Independent
|
|
|
13
13
|
Classifier: Programming Language :: Python :: 3
|
|
14
14
|
Requires-Python: >=3.10
|
|
15
15
|
Requires-Dist: httpx>=0.26.0
|
|
16
|
-
Requires-Dist: mcp[cli]
|
|
16
|
+
Requires-Dist: mcp[cli]==1.12.2
|
|
17
17
|
Requires-Dist: pathlib>=1.0.1
|
|
18
18
|
Requires-Dist: pillow>=10.0.0
|
|
19
19
|
Requires-Dist: pytest-asyncio>=1.0.0
|
|
@@ -371,16 +371,16 @@ For local installation configuration, authentication options, and advanced techn
|
|
|
371
371
|
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
372
372
|
- Returns: A clickable resource link for Meta authentication
|
|
373
373
|
|
|
374
|
-
22. `
|
|
375
|
-
- Create a budget schedule for a Meta Ads campaign
|
|
374
|
+
22. `mcp_meta_ads_create_budget_schedule`
|
|
375
|
+
- Create a budget schedule for a Meta Ads campaign
|
|
376
376
|
- Inputs:
|
|
377
|
-
- `campaign_id`: Meta Ads campaign ID
|
|
378
|
-
- `budget_value`: Amount of budget increase
|
|
379
|
-
- `budget_value_type`: Type of budget value ("ABSOLUTE" or "MULTIPLIER")
|
|
380
|
-
- `time_start`: Unix timestamp for when the high demand period should start
|
|
381
|
-
- `time_end`: Unix timestamp for when the high demand period should end
|
|
382
|
-
- `access_token` (optional): Meta API access token
|
|
383
|
-
- Returns: JSON string with the ID of the created budget schedule or an error message
|
|
377
|
+
- `campaign_id`: Meta Ads campaign ID
|
|
378
|
+
- `budget_value`: Amount of budget increase
|
|
379
|
+
- `budget_value_type`: Type of budget value ("ABSOLUTE" or "MULTIPLIER")
|
|
380
|
+
- `time_start`: Unix timestamp for when the high demand period should start
|
|
381
|
+
- `time_end`: Unix timestamp for when the high demand period should end
|
|
382
|
+
- `access_token` (optional): Meta API access token
|
|
383
|
+
- Returns: JSON string with the ID of the created budget schedule or an error message
|
|
384
384
|
|
|
385
385
|
23. `mcp_meta_ads_search_interests`
|
|
386
386
|
- Search for interest targeting options by keyword
|
|
@@ -398,7 +398,7 @@ For local installation configuration, authentication options, and advanced techn
|
|
|
398
398
|
- `limit`: Maximum number of suggestions to return (default: 25)
|
|
399
399
|
- Returns: Suggested interests with id, name, audience_size, and description fields
|
|
400
400
|
|
|
401
|
-
|
|
401
|
+
25. `mcp_meta_ads_validate_interests`
|
|
402
402
|
- Validate interest names or IDs for targeting
|
|
403
403
|
- Inputs:
|
|
404
404
|
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
@@ -406,14 +406,14 @@ For local installation configuration, authentication options, and advanced techn
|
|
|
406
406
|
- `interest_fbid_list`: List of interest IDs to validate (e.g., ["6003700426513"])
|
|
407
407
|
- Returns: Validation results showing valid status and audience_size for each interest
|
|
408
408
|
|
|
409
|
-
|
|
409
|
+
26. `mcp_meta_ads_search_behaviors`
|
|
410
410
|
- Get all available behavior targeting options
|
|
411
411
|
- Inputs:
|
|
412
412
|
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
413
413
|
- `limit`: Maximum number of results to return (default: 50)
|
|
414
414
|
- Returns: Behavior targeting options with id, name, audience_size bounds, path, and description
|
|
415
415
|
|
|
416
|
-
|
|
416
|
+
27. `mcp_meta_ads_search_demographics`
|
|
417
417
|
- Get demographic targeting options
|
|
418
418
|
- Inputs:
|
|
419
419
|
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
@@ -421,7 +421,7 @@ For local installation configuration, authentication options, and advanced techn
|
|
|
421
421
|
- `limit`: Maximum number of results to return (default: 50)
|
|
422
422
|
- Returns: Demographic targeting options with id, name, audience_size bounds, path, and description
|
|
423
423
|
|
|
424
|
-
|
|
424
|
+
28. `mcp_meta_ads_search_geo_locations`
|
|
425
425
|
- Search for geographic targeting locations
|
|
426
426
|
- Inputs:
|
|
427
427
|
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
@@ -430,7 +430,7 @@ For local installation configuration, authentication options, and advanced techn
|
|
|
430
430
|
- `limit`: Maximum number of results to return (default: 25)
|
|
431
431
|
- Returns: Location data with key, name, type, and geographic hierarchy information
|
|
432
432
|
|
|
433
|
-
|
|
433
|
+
29. `mcp_meta_ads_search` (Enhanced)
|
|
434
434
|
- Generic search across accounts, campaigns, ads, and pages
|
|
435
435
|
- Automatically includes page searching when query mentions "page" or "pages"
|
|
436
436
|
- Inputs:
|
|
@@ -479,7 +479,7 @@ The easiest way to avoid any setup issues is to **[🎯 use our Remote MCP inste
|
|
|
479
479
|
For comprehensive troubleshooting, debugging, and local installation issues, see our **[Local Installation Guide](LOCAL_INSTALLATION.md)** which includes:
|
|
480
480
|
|
|
481
481
|
- Authentication troubleshooting
|
|
482
|
-
- Installation issues and solutions
|
|
482
|
+
- Installation issues and solutions
|
|
483
483
|
- API error resolution
|
|
484
484
|
- Debug logs and diagnostic commands
|
|
485
|
-
- Performance optimization tips
|
|
485
|
+
- Performance optimization tips
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
meta_ads_mcp/__init__.py,sha256=
|
|
1
|
+
meta_ads_mcp/__init__.py,sha256=XuSDqKHzz24tD7w_n-jpx5OHOhle9OiucexV-62FU_4,1477
|
|
2
2
|
meta_ads_mcp/__main__.py,sha256=XaQt3iXftG_7f0Zu7Wop9SeFgrD2WBn0EQOaPMc27d8,207
|
|
3
3
|
meta_ads_mcp/core/__init__.py,sha256=IEJtqpyUo0CZSUWeQPljQ-D2vKorTFwXnpBQWSi1hIM,1819
|
|
4
4
|
meta_ads_mcp/core/accounts.py,sha256=7Zoqq0zMIJi_Xsxe9-_b3EYx-UTeieJJvO7HxVRuUS0,4327
|
|
5
|
-
meta_ads_mcp/core/ads.py,sha256=
|
|
5
|
+
meta_ads_mcp/core/ads.py,sha256=gda9FRDAgIFzUjLuyKVWB0H-CfEvWI7hdbB3B22BTUg,60306
|
|
6
6
|
meta_ads_mcp/core/ads_library.py,sha256=smGz9FhM6RIUjlQT4Jv1BaZmXahGdK21eRCB7QMhK-4,3228
|
|
7
|
-
meta_ads_mcp/core/adsets.py,sha256=
|
|
7
|
+
meta_ads_mcp/core/adsets.py,sha256=3Ok3EwPTReKshtsVs4gRMlws6LMTUJTb4ZeGPPM8JR8,16570
|
|
8
8
|
meta_ads_mcp/core/api.py,sha256=58F6fRrg3ny_vuLgHu1ZN1yueNAxVXz_nEcF6JlxlWk,16469
|
|
9
9
|
meta_ads_mcp/core/auth.py,sha256=l_IvejK2KYXg8yhBiP0ifE6mGwJ6ZujqYQbVw1KOUME,23649
|
|
10
10
|
meta_ads_mcp/core/authentication.py,sha256=ftoKec1HpfYCCVYIVKUD3ezvVAk6n_CJlBuePn8fzpM,10547
|
|
@@ -21,8 +21,8 @@ meta_ads_mcp/core/resources.py,sha256=-zIIfZulpo76vcKv6jhAlQq91cR2SZ3cjYZt3ek3x0
|
|
|
21
21
|
meta_ads_mcp/core/server.py,sha256=9SlgM_qvdlxo24ctnZzLgW1e1nfAspCSx3YyJQkKP64,17856
|
|
22
22
|
meta_ads_mcp/core/targeting.py,sha256=-QziS2MvTWzM02pwiUtId4sblWURd3UYPR_YYfVuiUk,13913
|
|
23
23
|
meta_ads_mcp/core/utils.py,sha256=ytj41yC5SqduLrAiZYBSd6OUwlJRaIClTwnnYKpNFds,9387
|
|
24
|
-
meta_ads_mcp-0.11.
|
|
25
|
-
meta_ads_mcp-0.11.
|
|
26
|
-
meta_ads_mcp-0.11.
|
|
27
|
-
meta_ads_mcp-0.11.
|
|
28
|
-
meta_ads_mcp-0.11.
|
|
24
|
+
meta_ads_mcp-0.11.3.dist-info/METADATA,sha256=-aZjT1svggAzROezO06i6qUHssheEoWUytVXxpG8LEk,24245
|
|
25
|
+
meta_ads_mcp-0.11.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
26
|
+
meta_ads_mcp-0.11.3.dist-info/entry_points.txt,sha256=Dv2RkoBjRJBqj6CyhwqGIiwPCD-SCL1-7B9-zmVRuv0,57
|
|
27
|
+
meta_ads_mcp-0.11.3.dist-info/licenses/LICENSE,sha256=E2d762fbhwKRYn8o7J6Szr6vyBPrHVDlK3jbHPx-d84,3851
|
|
28
|
+
meta_ads_mcp-0.11.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|