meta-ads-mcp 0.3.6__py3-none-any.whl → 0.3.8__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meta-ads-mcp
3
- Version: 0.3.6
3
+ Version: 0.3.8
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
@@ -11,9 +11,9 @@ Keywords: ads,api,claude,facebook,mcp,meta
11
11
  Classifier: License :: OSI Approved :: MIT License
12
12
  Classifier: Operating System :: OS Independent
13
13
  Classifier: Programming Language :: Python :: 3
14
- Requires-Python: >=3.9.6
14
+ Requires-Python: >=3.10
15
15
  Requires-Dist: httpx>=0.26.0
16
- Requires-Dist: mcp[cli]>=1.6.0
16
+ Requires-Dist: mcp[cli]>=1.9.0
17
17
  Requires-Dist: pathlib>=1.0.1
18
18
  Requires-Dist: pillow>=10.0.0
19
19
  Requires-Dist: python-dateutil>=2.8.2
@@ -27,9 +27,35 @@ A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for in
27
27
 
28
28
  > **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.
29
29
 
30
- **Screenshot**: Using an LLM to understand your ad performance:
30
+ [![Meta Ads MCP Server Demo](https://github.com/user-attachments/assets/3e605cee-d289-414b-814c-6299e7f3383e)](https://github.com/user-attachments/assets/3e605cee-d289-414b-814c-6299e7f3383e)
31
31
 
32
- ![Meta Ads MCP in action: Visualize ad performance metrics and creative details directly in Claude or your favorite MCP client, with rich insights about campaign reach, engagement, and costs](./images/meta-ads-example.png)
32
+
33
+ ## Community & Support
34
+
35
+ - [Discord](https://discord.gg/hNxpJcqM52). Join the community.
36
+ - [Email Support](info@pipeboard.co). Email us for support.
37
+
38
+ ## Quick Start
39
+
40
+ 1. Sign-up to [Pipeboard](https://pipeboard.co) to authenticate with Meta (alternatively, you can setup your own [custom meta app](CUSTOM_META_APP.md))
41
+ 2. Get your Pipeboard token at [pipeboard.co/api-tokens](https://pipeboard.co/api-tokens)
42
+ 3. Add this configuration to your MCP client:
43
+
44
+ ```json
45
+ "mcpServers": {
46
+ "meta-ads": {
47
+ "command": "uvx",
48
+ "args": ["meta-ads-mcp"],
49
+ "env": {
50
+ "PIPEBOARD_API_TOKEN": "your_pipeboard_token" // Get your token at https://pipeboard.co/api-tokens
51
+ }
52
+ }
53
+ }
54
+ ```
55
+
56
+ That's it! You can now use Meta Ads MCP in your favorite MCP client.
57
+
58
+ > **Note**: If you prefer to use your own Meta Developer App instead of Pipeboard authentication, see [CUSTOM_META_APP.md](CUSTOM_META_APP.md) for instructions.
33
59
 
34
60
  ## Features
35
61
 
@@ -44,56 +70,80 @@ A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for in
44
70
  - **Simple Authentication**: Easy setup with secure OAuth authentication
45
71
  - **Cross-Platform Support**: Works on Windows, macOS, and Linux
46
72
 
47
- ## Installation
73
+ ## Advanced Setup
48
74
 
49
- ### Using uv (recommended)
75
+ ### Development Installation
50
76
 
51
- When using uv no specific installation is needed. We can use uvx to directly run meta-ads-mcp:
77
+ If you're contributing to the project or need to run it directly:
52
78
 
53
79
  ```bash
54
- # Run with Meta authentication
55
- uvx meta-ads-mcp --app-id YOUR_META_ADS_APP_ID
80
+ # From the repository root
81
+ uv pip install -e .
56
82
  ```
57
83
 
58
- If you want to install the package:
84
+ ## Privacy and Security
59
85
 
60
- ```bash
61
- uv pip install meta-ads-mcp
62
- ```
86
+ The Meta Ads MCP follows security best practices:
63
87
 
64
- For development (if you've cloned the repository):
88
+ 1. Tokens are cached in a platform-specific secure location:
89
+ - Windows: `%APPDATA%\meta-ads-mcp\token_cache.json`
90
+ - macOS: `~/Library/Application Support/meta-ads-mcp/token_cache.json`
91
+ - Linux: `~/.config/meta-ads-mcp/token_cache.json`
65
92
 
66
- ```bash
67
- # From the repository root
68
- uv pip install -e .
69
- ```
93
+ 2. You do not need to provide your access token for each command; it will be automatically retrieved from the cache.
70
94
 
71
- ### Using pip
95
+ ## Testing
72
96
 
73
- Alternatively, you can install meta-ads-mcp via pip:
97
+ ### LLM Interface Testing
74
98
 
75
- ```bash
76
- pip install meta-ads-mcp
77
- ```
99
+ When using the Meta Ads MCP with an LLM interface (like Claude):
78
100
 
79
- After installation, you can run it as:
101
+ 1. Ensure the PIPEBOARD_API_TOKEN environment variable is set
102
+ 2. Verify account access by calling `mcp_meta_ads_get_ad_accounts`
103
+ 3. Check specific account details with `mcp_meta_ads_get_account_info`
80
104
 
81
- ```bash
82
- # Run with Meta authentication
83
- python -m meta_ads_mcp --app-id YOUR_META_ADS_APP_ID
84
- ```
105
+ ## Troubleshooting
106
+
107
+ ### Authentication Issues
108
+
109
+ If you encounter authentication issues:
110
+
111
+ 1. Verify your Pipeboard setup:
112
+ - Check that `PIPEBOARD_API_TOKEN` is set correctly
113
+ - Verify your token in the Pipeboard dashboard
114
+ - Try forcing a new login: `python test_pipeboard_auth.py --force-login`
115
+
116
+ 2. When using the LLM interface:
117
+ - Ensure the PIPEBOARD_API_TOKEN environment variable is set
118
+ - Check that the callback server is running properly
119
+
120
+ ### API Errors
121
+
122
+ If you receive errors from the Meta API:
123
+ 1. Ensure the user has appropriate permissions on the ad accounts
124
+ 2. Check if there are rate limits or other restrictions
125
+ 3. Verify your Pipeboard token hasn't expired
126
+
127
+ ## Log Location
128
+
129
+ Log files are stored in a platform-specific location:
130
+
131
+ - **macOS**: `~/Library/Application Support/meta-ads-mcp/meta_ads_debug.log`
132
+ - **Windows**: `%APPDATA%\meta-ads-mcp\meta_ads_debug.log`
133
+ - **Linux**: `~/.config/meta-ads-mcp/meta_ads_debug.log`
85
134
 
86
135
  ## Configuration
87
136
 
88
- ### Create a Meta Developer App (Required)
137
+ ### Pipeboard Authentication
89
138
 
90
- Before using the MCP server, you'll need to set up a Meta Developer App:
139
+ The easiest way to use Meta Ads MCP is with Pipeboard authentication:
91
140
 
92
- 1. Go to [Meta for Developers](https://developers.facebook.com/) and create a new app
93
- 2. Choose the "Business" app type
94
- 3. In your app settings, add the "Marketing API" product
95
- 4. Configure your app's OAuth redirect URI to include `http://localhost:8888/callback`
96
- 5. Note your App ID (Client ID) for use with the MCP
141
+ 1. Sign up at [Pipeboard.co](https://pipeboard.co) and generate an API token
142
+ 2. Set the environment variable:
143
+ ```bash
144
+ export PIPEBOARD_API_TOKEN=your_pipeboard_token
145
+ ```
146
+ 3. Run meta-ads-mcp - it will handle authentication automatically
97
147
 
98
148
  ### Usage with Cursor or Claude Desktop
99
149
 
@@ -103,11 +153,18 @@ Add this to your `claude_desktop_config.json` to integrate with Claude or `~/.cu
103
153
  "mcpServers": {
104
154
  "meta-ads": {
105
155
  "command": "uvx",
106
- "args": ["meta-ads-mcp", "--app-id", "YOUR_META_ADS_APP_ID"]
156
+ "args": ["meta-ads-mcp"],
157
+ "env": {
158
+ "PIPEBOARD_API_TOKEN": "your_pipeboard_token" // Get your token at https://pipeboard.co
159
+ }
107
160
  }
108
161
  }
109
162
  ```
110
163
 
164
+ ## Transports
165
+
166
+ Meta Ads MCP uses **stdio transport** by default, which works with MCP clients like Claude Desktop and Cursor. For web applications and direct HTTP API access, see [STREAMABLE_HTTP_SETUP.md](STREAMABLE_HTTP_SETUP.md) for streamable HTTP transport configuration.
167
+
111
168
  ### Available MCP Tools
112
169
 
113
170
  1. `mcp_meta_ads_get_ad_accounts`
@@ -319,157 +376,3 @@ Add this to your `claude_desktop_config.json` to integrate with Claude or `~/.cu
319
376
  - `time_end`: Unix timestamp for when the high demand period should end.
320
377
  - `access_token` (optional): Meta API access token.
321
378
  - Returns: JSON string with the ID of the created budget schedule or an error message.
322
-
323
- ## Authentication
324
-
325
- The Meta Ads MCP uses Meta's OAuth 2.0 authentication flow, designed for desktop apps:
326
-
327
- When authenticating, it will:
328
-
329
- 1. Start a local callback server on your machine
330
- 2. Open a browser window to authenticate with Meta
331
- 3. Ask you to authorize the app
332
- 4. Redirect back to the local server to extract and store the token securely
333
-
334
- This method requires you to [create a Meta Developer App](#create-a-meta-developer-app) as described above.
335
-
336
- ## Troubleshooting and Logging
337
-
338
- The Meta Ads MCP includes a comprehensive logging system to help troubleshoot issues:
339
-
340
- ### Log Location
341
-
342
- Log files are stored in a platform-specific location:
343
-
344
- - **macOS**: `~/Library/Application Support/meta-ads-mcp/meta_ads_debug.log`
345
- - **Windows**: `%APPDATA%\meta-ads-mcp\meta_ads_debug.log`
346
- - **Linux**: `~/.config/meta-ads-mcp/meta_ads_debug.log`
347
-
348
- ### Common Issues
349
-
350
- #### Authentication Issues
351
-
352
- If you encounter errors like `(#200) Provide valid app ID`, check the following:
353
- - Ensure you've set up a Meta Developer App correctly
354
- - Verify that you're passing the correct App ID using one of these methods:
355
- - Set the `META_APP_ID` environment variable: `export META_APP_ID=your_app_id`
356
- - Pass it as a command-line argument: `meta-ads-mcp --app-id your_app_id`
357
-
358
- #### API Errors
359
-
360
- If you receive errors from the Meta API:
361
-
362
- 1. Verify your app has the Marketing API product added
363
- 2. Ensure the user has appropriate permissions on the ad accounts
364
- 3. Check if there are rate limits or other restrictions on your app
365
-
366
- ### Debugging Command
367
-
368
- For specific image download issues, use the built-in diagnostic tool:
369
-
370
- ```python
371
- # Using direct tool call
372
- mcp_meta_ads_debug_image_download(ad_id="your_ad_id")
373
- ```
374
-
375
- This will give you detailed information about the download process and potential issues.
376
-
377
- ## Running with Different App IDs
378
-
379
- If you need to use different Meta App IDs for different purposes:
380
-
381
- ```bash
382
- # Using environment variable
383
- export META_APP_ID=your_app_id
384
- uvx meta-ads-mcp
385
-
386
- # Or using command line argument
387
- uvx meta-ads-mcp --app-id=your_app_id
388
- ```
389
-
390
- ## Privacy and Security
391
-
392
- The Meta Ads MCP follows security best practices:
393
-
394
- 1. Tokens are cached in a platform-specific secure location:
395
- - Windows: `%APPDATA%\meta-ads-mcp\token_cache.json`
396
- - macOS: `~/Library/Application Support/meta-ads-mcp/token_cache.json`
397
- - Linux: `~/.config/meta-ads-mcp/token_cache.json`
398
-
399
- 2. You do not need to provide your access token for each command; it will be automatically retrieved from the cache.
400
-
401
- 3. You can set the `META_APP_ID` environment variable instead of passing it as an argument:
402
- ```bash
403
- export META_APP_ID=your_app_id
404
- uvx meta-ads-mcp
405
- ```
406
-
407
- 4. You can provide a direct access token using the `META_ACCESS_TOKEN` environment variable. This bypasses both the local token cache and the Pipeboard authentication method:
408
- ```bash
409
- export META_ACCESS_TOKEN=your_access_token
410
- uvx meta-ads-mcp
411
- ```
412
- This is useful for CI/CD pipelines or when you already have a valid access token from another source.
413
-
414
- ## Testing
415
-
416
- ### CLI Testing
417
-
418
- Run the test script to verify authentication and basic functionality:
419
-
420
- ```bash
421
- python test_meta_ads_auth.py --app-id YOUR_APP_ID
422
- ```
423
-
424
- Use the `--force-login` flag to force a new authentication even if a cached token exists:
425
-
426
- ```bash
427
- python test_meta_ads_auth.py --app-id YOUR_APP_ID --force-login
428
- ```
429
-
430
- ### LLM Interface Testing
431
-
432
- When using the Meta Ads MCP with an LLM interface (like Claude):
433
-
434
- 1. Test authentication by calling the `mcp_meta_ads_get_login_link` tool
435
- 2. Verify account access by calling `mcp_meta_ads_get_ad_accounts`
436
- 3. Check specific account details with `mcp_meta_ads_get_account_info`
437
-
438
- These functions will automatically handle authentication if needed and provide a clickable login link if required.
439
-
440
- ## Troubleshooting
441
-
442
- ### Authentication Issues
443
-
444
- If you encounter authentication issues:
445
-
446
- 1. When using the LLM interface:
447
- - Use the `mcp_meta_ads_get_login_link` tool to generate a fresh authentication link
448
- - Ensure you click the link and complete the authorization flow in your browser
449
- - Check that the callback server is running properly (the tool will report this)
450
-
451
- 2. When using direct Meta OAuth:
452
- - Run with `--force-login` to get a fresh token: `uvx meta-ads-mcp --login --app-id YOUR_APP_ID --force-login`
453
- - Make sure the terminal has permissions to open a browser window
454
-
455
- 3. Skip authentication entirely by providing a token directly:
456
- - If you already have a valid access token, you can bypass the authentication flow:
457
- - `export META_ACCESS_TOKEN=your_access_token`
458
- - This will ignore both the local token cache and the Pipeboard authentication
459
-
460
- ### API Errors
461
-
462
- If you receive errors from the Meta API:
463
-
464
- 1. Verify your app has the Marketing API product added
465
- 2. Ensure the user has appropriate permissions on the ad accounts
466
- 3. Check if there are rate limits or other restrictions on your app
467
-
468
- ## Versioning
469
-
470
- You can check the current version of the package:
471
-
472
- ```python
473
- import meta_ads_mcp
474
- print(meta_ads_mcp.__version__)
475
- ```
@@ -1,24 +1,24 @@
1
- meta_ads_mcp/__init__.py,sha256=HZ5-yaLTxk_DzYuRr0_vLonuqZfIVAOgzdB5gvspEcA,1236
1
+ meta_ads_mcp/__init__.py,sha256=k6KFlGKu2RuY7N8tuThfUV551Qe0giWO1lQSNinT-V0,1236
2
2
  meta_ads_mcp/__main__.py,sha256=XaQt3iXftG_7f0Zu7Wop9SeFgrD2WBn0EQOaPMc27d8,207
3
- meta_ads_mcp/api.py,sha256=bQ7D1yNDMu7mRWLj8NBPT09azzrGgDjZVepZLxl4QjI,84414
4
3
  meta_ads_mcp/core/__init__.py,sha256=NvRA_socbKPEXFXIYdso5jBHb8cEEpF_2Mwhe3Obguw,1105
5
4
  meta_ads_mcp/core/accounts.py,sha256=Nmp7lPxO9wmq25jWV7_H0LIqnEbBhpCVBlLGW2HUaq0,2277
6
5
  meta_ads_mcp/core/ads.py,sha256=b_81GlGHIM4jISvuDZmHNyc6uW7uD3ovX68ezBci9MM,29747
7
6
  meta_ads_mcp/core/ads_library.py,sha256=onStn9UkRqYDC60gOPS-iKDtP1plz6DygUb7hUZ0Jw8,2807
8
7
  meta_ads_mcp/core/adsets.py,sha256=WBPNaI7ITnUOnGMus4_0MX15DslOCzfM5q1zF1VWs2s,12408
9
- meta_ads_mcp/core/api.py,sha256=9Whcs2orILhPiWkAR3qGmJNouYE5uri_e_Jzeh5Hjn8,14208
8
+ meta_ads_mcp/core/api.py,sha256=aAzM6Q75VQOFXtr5D-mDmBRhxWK4wsiODsJYnR3mpDI,14994
10
9
  meta_ads_mcp/core/auth.py,sha256=pDARBh3NBNqCpxflVrVvR4VsWuIveFxQmb9-P-gLFDM,20730
11
- meta_ads_mcp/core/authentication.py,sha256=2MG13r28OlIcOIgPSRrGXJ2-4JSt3ifU-oB9tiOsrKQ,6511
10
+ meta_ads_mcp/core/authentication.py,sha256=PFqmN7ujtNsJCEDutDzs81peGWFJ8_0YLYI3-o8kmt4,6577
12
11
  meta_ads_mcp/core/budget_schedules.py,sha256=UxseExsvKAiPwfDCY9aycT4kys4xqeNytyq-yyDOxrs,2901
13
12
  meta_ads_mcp/core/callback_server.py,sha256=AUymElaVwHqFyqB2wgqf6A68KsqwtKoYmY-7JZZt8Ks,43286
14
- meta_ads_mcp/core/campaigns.py,sha256=H1ZQ9m2BkyxO7b6TPo6bOgBDGu0VCezXv-0BwmXFZ5E,10833
13
+ meta_ads_mcp/core/campaigns.py,sha256=Fd477GsD1Gx08Ve0uXUCvr4fC-xQCeVHPBwRVaeRQKk,10965
14
+ meta_ads_mcp/core/http_auth_integration.py,sha256=ZJHuxK1Kwtr9gvwfC5HZOLH5MW-HnDDKqJc4xuG5yVE,10060
15
15
  meta_ads_mcp/core/insights.py,sha256=XAm4uu83gWp84PEGqAJ3GFIqlvg7prh6MdD71JfvBCo,18072
16
16
  meta_ads_mcp/core/pipeboard_auth.py,sha256=VvbxEB8ZOhnMccLU7HI1HgaPWHCl5NGrzZCm-zzHze4,22798
17
17
  meta_ads_mcp/core/resources.py,sha256=-zIIfZulpo76vcKv6jhAlQq91cR2SZ3cjYZt3ek3x0w,1236
18
- meta_ads_mcp/core/server.py,sha256=5WofyJZGzeDhbGzLXPhQjT0XnZwo0syeK8TM_XnJo4Q,5507
19
- meta_ads_mcp/core/utils.py,sha256=EPmpBX3OZaTWRS_YuEk_PLLyLXj7DeR6Ks8WoaZ5JGQ,6366
20
- meta_ads_mcp-0.3.6.dist-info/METADATA,sha256=1MN-vTf7bgXXajtstLqv0A_HvRLAY2QH7jmagwLgcx4,19650
21
- meta_ads_mcp-0.3.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
22
- meta_ads_mcp-0.3.6.dist-info/entry_points.txt,sha256=Dv2RkoBjRJBqj6CyhwqGIiwPCD-SCL1-7B9-zmVRuv0,57
23
- meta_ads_mcp-0.3.6.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
24
- meta_ads_mcp-0.3.6.dist-info/RECORD,,
18
+ meta_ads_mcp/core/server.py,sha256=PmoJBuMi1PbUvF-IWxFb7uaO_yiEdMH4KcFnFiNhwk0,17574
19
+ meta_ads_mcp/core/utils.py,sha256=DsizDYuJnWUpkbShV1y5Qe8t47Qf59aPZ6O9v0hzdkY,6705
20
+ meta_ads_mcp-0.3.8.dist-info/METADATA,sha256=dqvQ1zpwldGTqpkcCH9uicMOOkM9C2lziTdlNAnjW0g,16913
21
+ meta_ads_mcp-0.3.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
22
+ meta_ads_mcp-0.3.8.dist-info/entry_points.txt,sha256=Dv2RkoBjRJBqj6CyhwqGIiwPCD-SCL1-7B9-zmVRuv0,57
23
+ meta_ads_mcp-0.3.8.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
24
+ meta_ads_mcp-0.3.8.dist-info/RECORD,,