meta-ads-mcp 0.2.4__py3-none-any.whl → 0.2.6__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 +3 -1
- meta_ads_mcp/core/ads.py +61 -1
- meta_ads_mcp/core/adsets.py +33 -3
- meta_ads_mcp/core/api.py +68 -24
- meta_ads_mcp/core/auth.py +109 -526
- meta_ads_mcp/core/authentication.py +10 -1
- meta_ads_mcp/core/callback_server.py +958 -0
- meta_ads_mcp/core/utils.py +10 -0
- {meta_ads_mcp-0.2.4.dist-info → meta_ads_mcp-0.2.6.dist-info}/METADATA +45 -14
- meta_ads_mcp-0.2.6.dist-info/RECORD +20 -0
- meta_ads_mcp-0.2.4.dist-info/RECORD +0 -19
- {meta_ads_mcp-0.2.4.dist-info → meta_ads_mcp-0.2.6.dist-info}/WHEEL +0 -0
- {meta_ads_mcp-0.2.4.dist-info → meta_ads_mcp-0.2.6.dist-info}/entry_points.txt +0 -0
meta_ads_mcp/core/utils.py
CHANGED
|
@@ -13,6 +13,16 @@ import logging
|
|
|
13
13
|
import pathlib
|
|
14
14
|
import platform
|
|
15
15
|
|
|
16
|
+
# Check for Meta app credentials in environment
|
|
17
|
+
META_APP_ID = os.environ.get("META_APP_ID", "")
|
|
18
|
+
META_APP_SECRET = os.environ.get("META_APP_SECRET", "")
|
|
19
|
+
|
|
20
|
+
# Print warning if Meta app credentials are not configured
|
|
21
|
+
if not META_APP_ID:
|
|
22
|
+
print("WARNING: META_APP_ID environment variable is not set. Authentication will not work properly.")
|
|
23
|
+
if not META_APP_SECRET:
|
|
24
|
+
print("WARNING: META_APP_SECRET environment variable is not set. Long-lived token exchange will not work.")
|
|
25
|
+
|
|
16
26
|
# Configure logging to file
|
|
17
27
|
def setup_logging():
|
|
18
28
|
"""Set up logging to file for troubleshooting."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: meta-ads-mcp
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Summary: Model Calling Protocol (MCP) plugin for interacting with Meta Ads API
|
|
5
5
|
Project-URL: Homepage, https://github.com/nictuku/meta-ads-mcp
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/nictuku/meta-ads-mcp/issues
|
|
@@ -21,16 +21,26 @@ Description-Content-Type: text/markdown
|
|
|
21
21
|
|
|
22
22
|
# Meta Ads MCP
|
|
23
23
|
|
|
24
|
-
A [Model
|
|
24
|
+
A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for interacting with Meta Ads API. This tool enables AI models to access, analyze, and manage Meta advertising campaigns through a standardized interface, allowing LLMs to retrieve performance data, visualize ad creatives, and provide strategic insights for Facebook, Instagram, and other Meta platforms.
|
|
25
|
+
|
|
26
|
+
> **DISCLAIMER:** This is an unofficial third-party tool and is not associated with, endorsed by, or affiliated with Meta in any way. This project is maintained independently and uses Meta's public APIs according to their terms of service. Meta, Facebook, Instagram, and other Meta brand names are trademarks of their respective owners.
|
|
27
|
+
|
|
28
|
+
Screenhot: using an LLM to understand your ad performance.
|
|
29
|
+
|
|
30
|
+

|
|
25
31
|
|
|
26
32
|
## Features
|
|
27
33
|
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
+
- **AI-Powered Campaign Analysis**: Let your favorite LLM analyze your campaigns and provide actionable insights on performance
|
|
35
|
+
- **Strategic Recommendations**: Receive data-backed suggestions for optimizing ad spend, targeting, and creative content
|
|
36
|
+
- **Automated Monitoring**: Ask any MCP-compatible LLM to track performance metrics and alert you about significant changes
|
|
37
|
+
- **Budget Optimization**: Get recommendations for reallocating budget to better-performing ad sets
|
|
38
|
+
- **Creative Improvement**: Receive feedback on ad copy, imagery, and calls-to-action
|
|
39
|
+
- **Campaign Management**: Request changes to campaigns, ad sets, and ads (all changes require explicit confirmation)
|
|
40
|
+
- **Cross-Platform Integration**: Works with Facebook, Instagram, and all Meta ad platforms
|
|
41
|
+
- **Universal LLM Support**: Compatible with any MCP client including Claude Desktop, Cursor, Cherry Studio, and more
|
|
42
|
+
- **Simple Authentication**: Easy setup with secure OAuth authentication
|
|
43
|
+
- **Cross-Platform Support**: Works on Windows, macOS, and Linux
|
|
34
44
|
|
|
35
45
|
## Installation
|
|
36
46
|
|
|
@@ -39,7 +49,7 @@ A [Model Calling Protocol (MCP)](https://github.com/anthropics/anthropic-tools)
|
|
|
39
49
|
When using uv no specific installation is needed. We can use uvx to directly run meta-ads-mcp:
|
|
40
50
|
|
|
41
51
|
```bash
|
|
42
|
-
uvx meta-ads-mcp
|
|
52
|
+
uvx meta-ads-mcp --app-id YOUR_META_ADS_APP_ID
|
|
43
53
|
```
|
|
44
54
|
|
|
45
55
|
If you want to install the package:
|
|
@@ -79,7 +89,7 @@ Add this to your `claude_desktop_config.json` to integrate with Claude in Cursor
|
|
|
79
89
|
"mcpServers": {
|
|
80
90
|
"meta-ads": {
|
|
81
91
|
"command": "uvx",
|
|
82
|
-
"args": ["meta-ads-mcp"]
|
|
92
|
+
"args": ["meta-ads-mcp", "--app-id", "YOUR_META_ADS_APP_ID"]
|
|
83
93
|
}
|
|
84
94
|
}
|
|
85
95
|
```
|
|
@@ -177,7 +187,28 @@ Add this to your `claude_desktop_config.json` to integrate with Claude in Cursor
|
|
|
177
187
|
- `ad_id`: Meta Ads ad ID
|
|
178
188
|
- Returns: The ad image ready for direct visual analysis
|
|
179
189
|
|
|
180
|
-
12. `
|
|
190
|
+
12. `mcp_meta_ads_update_ad`
|
|
191
|
+
- Update an ad with new settings
|
|
192
|
+
- Inputs:
|
|
193
|
+
- `ad_id`: Meta Ads ad ID
|
|
194
|
+
- `status`: Update ad status (ACTIVE, PAUSED, etc.)
|
|
195
|
+
- `bid_amount`: Bid amount in account currency (in cents for USD)
|
|
196
|
+
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
197
|
+
- Returns: Confirmation with updated ad details and a confirmation link
|
|
198
|
+
|
|
199
|
+
13. `mcp_meta_ads_update_adset`
|
|
200
|
+
- Update an ad set with new settings including frequency caps
|
|
201
|
+
- Inputs:
|
|
202
|
+
- `adset_id`: Meta Ads ad set ID
|
|
203
|
+
- `frequency_control_specs`: List of frequency control specifications
|
|
204
|
+
- `bid_strategy`: Bid strategy (e.g., 'LOWEST_COST_WITH_BID_CAP')
|
|
205
|
+
- `bid_amount`: Bid amount in account currency (in cents for USD)
|
|
206
|
+
- `status`: Update ad set status (ACTIVE, PAUSED, etc.)
|
|
207
|
+
- `targeting`: Targeting specifications including targeting_automation
|
|
208
|
+
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
209
|
+
- Returns: Confirmation with updated ad set details and a confirmation link
|
|
210
|
+
|
|
211
|
+
14. `mcp_meta_ads_get_insights`
|
|
181
212
|
- Get performance insights for a campaign, ad set, ad or account
|
|
182
213
|
- Inputs:
|
|
183
214
|
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
@@ -187,7 +218,7 @@ Add this to your `claude_desktop_config.json` to integrate with Claude in Cursor
|
|
|
187
218
|
- `level`: Level of aggregation (ad, adset, campaign, account)
|
|
188
219
|
- Returns: Performance metrics for the specified object
|
|
189
220
|
|
|
190
|
-
|
|
221
|
+
15. `mcp_meta_ads_debug_image_download`
|
|
191
222
|
- Debug image download issues and report detailed diagnostics
|
|
192
223
|
- Inputs:
|
|
193
224
|
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
@@ -195,7 +226,7 @@ Add this to your `claude_desktop_config.json` to integrate with Claude in Cursor
|
|
|
195
226
|
- `ad_id`: Meta Ads ad ID (optional, used if url is not provided)
|
|
196
227
|
- Returns: Diagnostic information about image download attempts
|
|
197
228
|
|
|
198
|
-
|
|
229
|
+
16. `mcp_meta_ads_get_login_link`
|
|
199
230
|
- Get a clickable login link for Meta Ads authentication
|
|
200
231
|
- Inputs:
|
|
201
232
|
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
@@ -350,4 +381,4 @@ You can check the current version of the package:
|
|
|
350
381
|
```python
|
|
351
382
|
import meta_ads_mcp
|
|
352
383
|
print(meta_ads_mcp.__version__)
|
|
353
|
-
```
|
|
384
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
meta_ads_mcp/__init__.py,sha256=r_A2NaKWasOAmt5IT2zhGrE2FRjVIMYiQKXZ9LMxTI0,1236
|
|
2
|
+
meta_ads_mcp/__main__.py,sha256=XaQt3iXftG_7f0Zu7Wop9SeFgrD2WBn0EQOaPMc27d8,207
|
|
3
|
+
meta_ads_mcp/api.py,sha256=9mmoJIdkC3PexZn3hw8XiKznecsbOSnhHtdEsJiPIyw,77475
|
|
4
|
+
meta_ads_mcp/core/__init__.py,sha256=BA93zC6D8CzKbLo4JqqNqahq2LVgWBsoIXmJCK4AdIc,924
|
|
5
|
+
meta_ads_mcp/core/accounts.py,sha256=Nmp7lPxO9wmq25jWV7_H0LIqnEbBhpCVBlLGW2HUaq0,2277
|
|
6
|
+
meta_ads_mcp/core/ads.py,sha256=jAwa1gD3HpXFhDW53cUMYwnt52jmBjTHTwb9HUk0EaA,16975
|
|
7
|
+
meta_ads_mcp/core/adsets.py,sha256=zSC67UhrhiinLY_SYSMNjRlmSZxCvyBYXIXroPBaVNc,7359
|
|
8
|
+
meta_ads_mcp/core/api.py,sha256=AurfnoUZoIq9WS4cnsmVqpxc3pdsws8jvNhzQzdzLGg,12209
|
|
9
|
+
meta_ads_mcp/core/auth.py,sha256=2uFGSD_6l8ExS1CQx7VQnPDq2yIb1fAk_t1BFFGQr7A,16881
|
|
10
|
+
meta_ads_mcp/core/authentication.py,sha256=6zoGorswj5kRbrt_18A8KrZdCORNLGHybvb7XRQ1yJg,3474
|
|
11
|
+
meta_ads_mcp/core/callback_server.py,sha256=b5TzUz9nEk0i5MWujlls5gAsHru__UjTPJQan1xQ_10,40947
|
|
12
|
+
meta_ads_mcp/core/campaigns.py,sha256=u5jNHSxcWlZgzVLNmaeoovA9OcPjSUjTegUMcDLAurs,4381
|
|
13
|
+
meta_ads_mcp/core/insights.py,sha256=f4Rs3kG0oqpKl8zBc_nt_zE0z4zvb9i0g12galrDiw8,17376
|
|
14
|
+
meta_ads_mcp/core/resources.py,sha256=-zIIfZulpo76vcKv6jhAlQq91cR2SZ3cjYZt3ek3x0w,1236
|
|
15
|
+
meta_ads_mcp/core/server.py,sha256=-tClGe4rc-8U2ihgpipLstiTPRg3-CnjsTRgncsNa_A,3055
|
|
16
|
+
meta_ads_mcp/core/utils.py,sha256=wxh722z-x0TSJwDEEeDylkv4VJqLmqnkZy-YGRzs4vQ,6049
|
|
17
|
+
meta_ads_mcp-0.2.6.dist-info/METADATA,sha256=4UUxhxKMIfZ9bvMfqW6CJb8-6bJibUaXElSsdmrFBa4,15300
|
|
18
|
+
meta_ads_mcp-0.2.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
19
|
+
meta_ads_mcp-0.2.6.dist-info/entry_points.txt,sha256=Dv2RkoBjRJBqj6CyhwqGIiwPCD-SCL1-7B9-zmVRuv0,57
|
|
20
|
+
meta_ads_mcp-0.2.6.dist-info/RECORD,,
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
meta_ads_mcp/__init__.py,sha256=xmCT88Y60ifMx7uGEKOJBAF0JC1buzGdGexT9svhDtU,1204
|
|
2
|
-
meta_ads_mcp/__main__.py,sha256=XaQt3iXftG_7f0Zu7Wop9SeFgrD2WBn0EQOaPMc27d8,207
|
|
3
|
-
meta_ads_mcp/api.py,sha256=9mmoJIdkC3PexZn3hw8XiKznecsbOSnhHtdEsJiPIyw,77475
|
|
4
|
-
meta_ads_mcp/core/__init__.py,sha256=BA93zC6D8CzKbLo4JqqNqahq2LVgWBsoIXmJCK4AdIc,924
|
|
5
|
-
meta_ads_mcp/core/accounts.py,sha256=Nmp7lPxO9wmq25jWV7_H0LIqnEbBhpCVBlLGW2HUaq0,2277
|
|
6
|
-
meta_ads_mcp/core/ads.py,sha256=TS37bUX8kJeeX4M2jv3StZev7Riq-n8Fm0TOhEL0eIY,14625
|
|
7
|
-
meta_ads_mcp/core/adsets.py,sha256=Wuk5EJywypFNbPgdLGJ13XK7O6v7TyfwdR4f1MObGzE,5739
|
|
8
|
-
meta_ads_mcp/core/api.py,sha256=vmMgX6pb4HkoLw3PXNekqrZCN4k06oZPtMF4128Wzz0,10133
|
|
9
|
-
meta_ads_mcp/core/auth.py,sha256=2F1v3kWfl83NC8X_IyH-JUu0pQYtxplKZ-G5KyWSVAw,37222
|
|
10
|
-
meta_ads_mcp/core/authentication.py,sha256=_lEi5XerkitD96jr6J8H9pUa1z1sp8SLr8iXvyr8fIg,2798
|
|
11
|
-
meta_ads_mcp/core/campaigns.py,sha256=u5jNHSxcWlZgzVLNmaeoovA9OcPjSUjTegUMcDLAurs,4381
|
|
12
|
-
meta_ads_mcp/core/insights.py,sha256=f4Rs3kG0oqpKl8zBc_nt_zE0z4zvb9i0g12galrDiw8,17376
|
|
13
|
-
meta_ads_mcp/core/resources.py,sha256=-zIIfZulpo76vcKv6jhAlQq91cR2SZ3cjYZt3ek3x0w,1236
|
|
14
|
-
meta_ads_mcp/core/server.py,sha256=-tClGe4rc-8U2ihgpipLstiTPRg3-CnjsTRgncsNa_A,3055
|
|
15
|
-
meta_ads_mcp/core/utils.py,sha256=ByVAoMoTlkAe2xtC2NRm9oqHrHiarsipXeWh0NZB2Xs,5574
|
|
16
|
-
meta_ads_mcp-0.2.4.dist-info/METADATA,sha256=5iT4VVpfdDReyxWKsE8ITIXkZdu4XvBvAq_UJs_z46U,12507
|
|
17
|
-
meta_ads_mcp-0.2.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
18
|
-
meta_ads_mcp-0.2.4.dist-info/entry_points.txt,sha256=Dv2RkoBjRJBqj6CyhwqGIiwPCD-SCL1-7B9-zmVRuv0,57
|
|
19
|
-
meta_ads_mcp-0.2.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|