meta-ads-mcp 0.3.1__tar.gz → 0.3.3__tar.gz
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-0.3.1 → meta_ads_mcp-0.3.3}/Dockerfile +2 -2
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/PKG-INFO +69 -132
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/README.md +68 -131
- meta_ads_mcp-0.3.3/brands/injurypayouts.com/120221013820800183_76c8b7fd0c627bce0d6ad833682f45e5.jpg +0 -0
- meta_ads_mcp-0.3.3/brands/injurypayouts.com/120221013841190183_cc1ff1ad28a037f397fd0e1636e8239a.jpg +0 -0
- meta_ads_mcp-0.3.3/brands/injurypayouts.com/120221013863110183_76f042047ce288bfbf9e103ffa10c50f.jpg +0 -0
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/meta_ads_mcp/__init__.py +1 -1
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/meta_ads_mcp/api.py +55 -1
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/meta_ads_mcp/core/__init__.py +2 -0
- meta_ads_mcp-0.3.3/meta_ads_mcp/core/ads.py +819 -0
- meta_ads_mcp-0.3.3/meta_ads_mcp/core/ads_library.py +69 -0
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/meta_ads_mcp/core/adsets.py +1 -1
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/meta_ads_mcp/core/api.py +1 -1
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/meta_ads_mcp/core/auth.py +13 -2
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/meta_ads_mcp/core/authentication.py +1 -1
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/meta_ads_mcp/core/callback_server.py +55 -1
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/meta_ads_mcp/core/campaigns.py +5 -2
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/pyproject.toml +1 -1
- meta_ads_mcp-0.3.1/meta_ads_mcp/core/ads.py +0 -357
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/.gitignore +0 -0
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/LICENSE +0 -0
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/META_API_NOTES.md +0 -0
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/debug_meta_api_tool.py +0 -0
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/debug_token_flow.py +0 -0
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/future_improvements.md +0 -0
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/images/meta-ads-example.png +0 -0
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/meta-ads-mcp +0 -0
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/meta_ads_auth.sh +0 -0
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/meta_ads_mcp/__main__.py +0 -0
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/meta_ads_mcp/core/accounts.py +0 -0
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/meta_ads_mcp/core/insights.py +0 -0
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/meta_ads_mcp/core/pipeboard_auth.py +0 -0
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/meta_ads_mcp/core/resources.py +0 -0
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/meta_ads_mcp/core/server.py +0 -0
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/meta_ads_mcp/core/utils.py +0 -0
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/meta_auth_test.sh +0 -0
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/requirements.txt +0 -0
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/setup.py +0 -0
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/smithery.yaml +0 -0
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/test_meta_ads_auth.py +0 -0
- {meta_ads_mcp-0.3.1 → meta_ads_mcp-0.3.3}/test_pipeboard_auth.py +0 -0
|
@@ -15,8 +15,8 @@ RUN pip install --upgrade pip && \
|
|
|
15
15
|
# Copy requirements file
|
|
16
16
|
COPY requirements.txt .
|
|
17
17
|
|
|
18
|
-
# Install dependencies using uv
|
|
19
|
-
RUN uv pip install -r requirements.txt
|
|
18
|
+
# Install dependencies using uv with --system flag
|
|
19
|
+
RUN uv pip install --system -r requirements.txt
|
|
20
20
|
|
|
21
21
|
# Copy the rest of the application
|
|
22
22
|
COPY . .
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: meta-ads-mcp
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
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
|
|
@@ -31,7 +31,7 @@ A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for in
|
|
|
31
31
|
<img width="380" height="200" src="https://glama.ai/mcp/servers/@pipeboard-co/meta-ads-mcp/badge" alt="Meta Ads MCP server" />
|
|
32
32
|
</a>
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Screenshot: using an LLM to understand your ad performance.
|
|
35
35
|
|
|
36
36
|

|
|
37
37
|
|
|
@@ -55,11 +55,7 @@ Screenhot: using an LLM to understand your ad performance.
|
|
|
55
55
|
When using uv no specific installation is needed. We can use uvx to directly run meta-ads-mcp:
|
|
56
56
|
|
|
57
57
|
```bash
|
|
58
|
-
#
|
|
59
|
-
export PIPEBOARD_API_TOKEN=your_pipeboard_token # Get your token at https://pipeboard.co
|
|
60
|
-
uvx meta-ads-mcp
|
|
61
|
-
|
|
62
|
-
# Alternative: Use with direct Meta authentication
|
|
58
|
+
# Run with Meta authentication
|
|
63
59
|
uvx meta-ads-mcp --app-id YOUR_META_ADS_APP_ID
|
|
64
60
|
```
|
|
65
61
|
|
|
@@ -87,50 +83,26 @@ pip install meta-ads-mcp
|
|
|
87
83
|
After installation, you can run it as:
|
|
88
84
|
|
|
89
85
|
```bash
|
|
90
|
-
#
|
|
91
|
-
export PIPEBOARD_API_TOKEN=your_pipeboard_token # Get your token at https://pipeboard.co
|
|
92
|
-
python -m meta_ads_mcp
|
|
93
|
-
|
|
94
|
-
# Alternative: Use with direct Meta authentication
|
|
86
|
+
# Run with Meta authentication
|
|
95
87
|
python -m meta_ads_mcp --app-id YOUR_META_ADS_APP_ID
|
|
96
88
|
```
|
|
97
89
|
|
|
98
90
|
## Configuration
|
|
99
91
|
|
|
100
|
-
###
|
|
92
|
+
### Create a Meta Developer App (Required)
|
|
101
93
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
1. Sign up at [Pipeboard.co](https://pipeboard.co) and generate an API token - **Get your free token at [https://pipeboard.co](https://pipeboard.co)**
|
|
105
|
-
2. Set the environment variable:
|
|
106
|
-
```bash
|
|
107
|
-
export PIPEBOARD_API_TOKEN=your_pipeboard_token # Token obtainable via https://pipeboard.co
|
|
108
|
-
```
|
|
109
|
-
3. Run meta-ads-mcp without needing to set up a Meta Developer App:
|
|
110
|
-
```bash
|
|
111
|
-
uvx meta-ads-mcp
|
|
112
|
-
```
|
|
94
|
+
Before using the MCP server, you'll need to set up a Meta Developer App:
|
|
113
95
|
|
|
114
|
-
|
|
96
|
+
1. Go to [Meta for Developers](https://developers.facebook.com/) and create a new app
|
|
97
|
+
2. Choose the "Consumer" app type
|
|
98
|
+
3. In your app settings, add the "Marketing API" product
|
|
99
|
+
4. Configure your app's OAuth redirect URI to include `http://localhost:8888/callback`
|
|
100
|
+
5. Note your App ID (Client ID) for use with the MCP
|
|
115
101
|
|
|
116
102
|
### Usage with Cursor or Claude Desktop
|
|
117
103
|
|
|
118
104
|
Add this to your `claude_desktop_config.json` to integrate with Claude or `~/.cursor/mcp.json` to integrate with Cursor:
|
|
119
105
|
|
|
120
|
-
```json
|
|
121
|
-
"mcpServers": {
|
|
122
|
-
"meta-ads": {
|
|
123
|
-
"command": "uvx",
|
|
124
|
-
"args": ["meta-ads-mcp"],
|
|
125
|
-
"env": {
|
|
126
|
-
"PIPEBOARD_API_TOKEN": "your_pipeboard_token" // Token obtainable via https://pipeboard.co
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
Or if you prefer direct Meta authentication (using your own Facebook app):
|
|
133
|
-
|
|
134
106
|
```json
|
|
135
107
|
"mcpServers": {
|
|
136
108
|
"meta-ads": {
|
|
@@ -157,7 +129,14 @@ Or if you prefer direct Meta authentication (using your own Facebook app):
|
|
|
157
129
|
- `account_id`: Meta Ads account ID (format: act_XXXXXXXXX)
|
|
158
130
|
- Returns: Detailed information about the specified account
|
|
159
131
|
|
|
160
|
-
3. `
|
|
132
|
+
3. `mcp_meta_ads_get_account_pages`
|
|
133
|
+
- Get pages associated with a Meta Ads account
|
|
134
|
+
- Inputs:
|
|
135
|
+
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
136
|
+
- `account_id`: Meta Ads account ID (format: act_XXXXXXXXX) or "me" for the current user's pages
|
|
137
|
+
- Returns: List of pages associated with the account, useful for ad creation and management
|
|
138
|
+
|
|
139
|
+
4. `mcp_meta_ads_get_campaigns`
|
|
161
140
|
- Get campaigns for a Meta Ads account with optional filtering
|
|
162
141
|
- Inputs:
|
|
163
142
|
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
@@ -166,14 +145,14 @@ Or if you prefer direct Meta authentication (using your own Facebook app):
|
|
|
166
145
|
- `status_filter`: Filter by status (empty for all, or 'ACTIVE', 'PAUSED', etc.)
|
|
167
146
|
- Returns: List of campaigns matching the criteria
|
|
168
147
|
|
|
169
|
-
|
|
148
|
+
5. `mcp_meta_ads_get_campaign_details`
|
|
170
149
|
- Get detailed information about a specific campaign
|
|
171
150
|
- Inputs:
|
|
172
151
|
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
173
152
|
- `campaign_id`: Meta Ads campaign ID
|
|
174
153
|
- Returns: Detailed information about the specified campaign
|
|
175
154
|
|
|
176
|
-
|
|
155
|
+
6. `mcp_meta_ads_create_campaign`
|
|
177
156
|
- Create a new campaign in a Meta Ads account
|
|
178
157
|
- Inputs:
|
|
179
158
|
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
@@ -186,7 +165,7 @@ Or if you prefer direct Meta authentication (using your own Facebook app):
|
|
|
186
165
|
- `lifetime_budget`: Lifetime budget in account currency (in cents)
|
|
187
166
|
- Returns: Confirmation with new campaign details
|
|
188
167
|
|
|
189
|
-
|
|
168
|
+
7. `mcp_meta_ads_get_adsets`
|
|
190
169
|
- Get ad sets for a Meta Ads account with optional filtering by campaign
|
|
191
170
|
- Inputs:
|
|
192
171
|
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
@@ -195,14 +174,14 @@ Or if you prefer direct Meta authentication (using your own Facebook app):
|
|
|
195
174
|
- `campaign_id`: Optional campaign ID to filter by
|
|
196
175
|
- Returns: List of ad sets matching the criteria
|
|
197
176
|
|
|
198
|
-
|
|
177
|
+
8. `mcp_meta_ads_get_adset_details`
|
|
199
178
|
- Get detailed information about a specific ad set
|
|
200
179
|
- Inputs:
|
|
201
180
|
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
202
181
|
- `adset_id`: Meta Ads ad set ID
|
|
203
182
|
- Returns: Detailed information about the specified ad set
|
|
204
183
|
|
|
205
|
-
|
|
184
|
+
9. `mcp_meta_ads_get_ads`
|
|
206
185
|
- Get ads for a Meta Ads account with optional filtering
|
|
207
186
|
- Inputs:
|
|
208
187
|
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
@@ -212,28 +191,28 @@ Or if you prefer direct Meta authentication (using your own Facebook app):
|
|
|
212
191
|
- `adset_id`: Optional ad set ID to filter by
|
|
213
192
|
- Returns: List of ads matching the criteria
|
|
214
193
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
194
|
+
10. `mcp_meta_ads_get_ad_details`
|
|
195
|
+
- Get detailed information about a specific ad
|
|
196
|
+
- Inputs:
|
|
197
|
+
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
198
|
+
- `ad_id`: Meta Ads ad ID
|
|
199
|
+
- Returns: Detailed information about the specified ad
|
|
221
200
|
|
|
222
|
-
|
|
201
|
+
11. `mcp_meta_ads_get_ad_creatives`
|
|
223
202
|
- Get creative details for a specific ad
|
|
224
203
|
- Inputs:
|
|
225
204
|
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
226
205
|
- `ad_id`: Meta Ads ad ID
|
|
227
206
|
- Returns: Creative details including text, images, and URLs
|
|
228
207
|
|
|
229
|
-
|
|
208
|
+
12. `mcp_meta_ads_get_ad_image`
|
|
230
209
|
- Get, download, and visualize a Meta ad image in one step
|
|
231
210
|
- Inputs:
|
|
232
211
|
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
233
212
|
- `ad_id`: Meta Ads ad ID
|
|
234
213
|
- Returns: The ad image ready for direct visual analysis
|
|
235
214
|
|
|
236
|
-
|
|
215
|
+
13. `mcp_meta_ads_update_ad`
|
|
237
216
|
- Update an ad with new settings
|
|
238
217
|
- Inputs:
|
|
239
218
|
- `ad_id`: Meta Ads ad ID
|
|
@@ -242,7 +221,7 @@ Or if you prefer direct Meta authentication (using your own Facebook app):
|
|
|
242
221
|
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
243
222
|
- Returns: Confirmation with updated ad details and a confirmation link
|
|
244
223
|
|
|
245
|
-
|
|
224
|
+
14. `mcp_meta_ads_update_adset`
|
|
246
225
|
- Update an ad set with new settings including frequency caps
|
|
247
226
|
- Inputs:
|
|
248
227
|
- `adset_id`: Meta Ads ad set ID
|
|
@@ -254,7 +233,7 @@ Or if you prefer direct Meta authentication (using your own Facebook app):
|
|
|
254
233
|
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
255
234
|
- Returns: Confirmation with updated ad set details and a confirmation link
|
|
256
235
|
|
|
257
|
-
|
|
236
|
+
15. `mcp_meta_ads_get_insights`
|
|
258
237
|
- Get performance insights for a campaign, ad set, ad or account
|
|
259
238
|
- Inputs:
|
|
260
239
|
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
@@ -264,7 +243,7 @@ Or if you prefer direct Meta authentication (using your own Facebook app):
|
|
|
264
243
|
- `level`: Level of aggregation (ad, adset, campaign, account)
|
|
265
244
|
- Returns: Performance metrics for the specified object
|
|
266
245
|
|
|
267
|
-
|
|
246
|
+
16. `mcp_meta_ads_debug_image_download`
|
|
268
247
|
- Debug image download issues and report detailed diagnostics
|
|
269
248
|
- Inputs:
|
|
270
249
|
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
@@ -272,56 +251,15 @@ Or if you prefer direct Meta authentication (using your own Facebook app):
|
|
|
272
251
|
- `ad_id`: Meta Ads ad ID (optional, used if url is not provided)
|
|
273
252
|
- Returns: Diagnostic information about image download attempts
|
|
274
253
|
|
|
275
|
-
|
|
254
|
+
17. `mcp_meta_ads_get_login_link`
|
|
276
255
|
- Get a clickable login link for Meta Ads authentication
|
|
277
|
-
- NOTE: This method should only be used if you're using your own Facebook app. If using Pipeboard authentication (recommended), set the PIPEBOARD_API_TOKEN environment variable instead (token obtainable via https://pipeboard.co).
|
|
278
256
|
- Inputs:
|
|
279
257
|
- `access_token` (optional): Meta API access token (will use cached token if not provided)
|
|
280
258
|
- Returns: A clickable resource link for Meta authentication
|
|
281
259
|
|
|
282
|
-
## Create a Meta Developer App
|
|
283
|
-
|
|
284
|
-
Before using the MCP server, you'll need to set up a Meta Developer App:
|
|
285
|
-
|
|
286
|
-
1. Go to [Meta for Developers](https://developers.facebook.com/) and create a new app
|
|
287
|
-
2. Choose the "Consumer" app type
|
|
288
|
-
3. In your app settings, add the "Marketing API" product
|
|
289
|
-
4. Configure your app's OAuth redirect URI to include `http://localhost:8888/callback`
|
|
290
|
-
5. Note your App ID (Client ID) for use with the MCP
|
|
291
|
-
|
|
292
260
|
## Authentication
|
|
293
261
|
|
|
294
|
-
The Meta Ads MCP
|
|
295
|
-
|
|
296
|
-
### 1. Pipeboard Authentication (Recommended ⭐)
|
|
297
|
-
|
|
298
|
-
This method uses [Pipeboard.co](https://pipeboard.co) to manage Meta API authentication, providing longer-lived tokens and a simplified flow:
|
|
299
|
-
|
|
300
|
-
1. **Get your Pipeboard token**: Sign up at [https://pipeboard.co](https://pipeboard.co) to generate your free API token
|
|
301
|
-
2. Set the `PIPEBOARD_API_TOKEN` environment variable with your token:
|
|
302
|
-
```bash
|
|
303
|
-
export PIPEBOARD_API_TOKEN=your_pipeboard_token
|
|
304
|
-
```
|
|
305
|
-
3. Run the Meta Ads MCP normally - it will automatically detect and use Pipeboard authentication:
|
|
306
|
-
```bash
|
|
307
|
-
uvx meta-ads-mcp
|
|
308
|
-
```
|
|
309
|
-
4. The first time you run a command, you'll be provided with a login URL to authorize with Meta
|
|
310
|
-
|
|
311
|
-
**Benefits of Pipeboard authentication:**
|
|
312
|
-
- ✅ Longer-lived tokens (60 days)
|
|
313
|
-
- ✅ No need to configure a Meta Developer App
|
|
314
|
-
- ✅ Simpler setup with just an API token
|
|
315
|
-
- ✅ Automatic token renewal
|
|
316
|
-
|
|
317
|
-
To test the Pipeboard authentication flow:
|
|
318
|
-
```bash
|
|
319
|
-
python test_pipeboard_auth.py --api-token YOUR_PIPEBOARD_TOKEN
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
### 2. Direct Meta OAuth (Legacy)
|
|
323
|
-
|
|
324
|
-
The traditional OAuth 2.0 flow designed for desktop apps. This method should only be used if you are using your own Facebook app instead of Pipeboard.
|
|
262
|
+
The Meta Ads MCP uses Meta's OAuth 2.0 authentication flow, designed for desktop apps:
|
|
325
263
|
|
|
326
264
|
When authenticating, it will:
|
|
327
265
|
|
|
@@ -330,7 +268,7 @@ When authenticating, it will:
|
|
|
330
268
|
3. Ask you to authorize the app
|
|
331
269
|
4. Redirect back to the local server to extract and store the token securely
|
|
332
270
|
|
|
333
|
-
This method requires you to [create a Meta Developer App](#create-a-meta-developer-app)
|
|
271
|
+
This method requires you to [create a Meta Developer App](#create-a-meta-developer-app) as described above.
|
|
334
272
|
|
|
335
273
|
## Troubleshooting and Logging
|
|
336
274
|
|
|
@@ -348,19 +286,11 @@ Log files are stored in a platform-specific location:
|
|
|
348
286
|
|
|
349
287
|
#### Authentication Issues
|
|
350
288
|
|
|
351
|
-
If you
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
- Verify your token in the Pipeboard dashboard
|
|
357
|
-
|
|
358
|
-
2. For App ID issues (when using direct authentication):
|
|
359
|
-
If you encounter errors like `(#200) Provide valid app ID`, check the following:
|
|
360
|
-
- Ensure you've set up a Meta Developer App correctly
|
|
361
|
-
- Verify that you're passing the correct App ID using one of these methods:
|
|
362
|
-
- Set the `META_APP_ID` environment variable: `export META_APP_ID=your_app_id`
|
|
363
|
-
- Pass it as a command-line argument: `meta-ads-mcp --app-id your_app_id`
|
|
289
|
+
If you encounter errors like `(#200) Provide valid app ID`, check the following:
|
|
290
|
+
- Ensure you've set up a Meta Developer App correctly
|
|
291
|
+
- Verify that you're passing the correct App ID using one of these methods:
|
|
292
|
+
- Set the `META_APP_ID` environment variable: `export META_APP_ID=your_app_id`
|
|
293
|
+
- Pass it as a command-line argument: `meta-ads-mcp --app-id your_app_id`
|
|
364
294
|
|
|
365
295
|
#### API Errors
|
|
366
296
|
|
|
@@ -399,15 +329,24 @@ uvx meta-ads-mcp --app-id=your_app_id
|
|
|
399
329
|
The Meta Ads MCP follows security best practices:
|
|
400
330
|
|
|
401
331
|
1. Tokens are cached in a platform-specific secure location:
|
|
402
|
-
- Windows: `%APPDATA%\meta-ads-mcp\token_cache.json`
|
|
403
|
-
- macOS: `~/Library/Application Support/meta-ads-mcp/token_cache.json`
|
|
404
|
-
- Linux: `~/.config/meta-ads-mcp/token_cache.json`
|
|
332
|
+
- Windows: `%APPDATA%\meta-ads-mcp\token_cache.json`
|
|
333
|
+
- macOS: `~/Library/Application Support/meta-ads-mcp/token_cache.json`
|
|
334
|
+
- Linux: `~/.config/meta-ads-mcp/token_cache.json`
|
|
405
335
|
|
|
406
336
|
2. You do not need to provide your access token for each command; it will be automatically retrieved from the cache.
|
|
407
337
|
|
|
408
|
-
3. You can set the
|
|
409
|
-
|
|
410
|
-
|
|
338
|
+
3. You can set the `META_APP_ID` environment variable instead of passing it as an argument:
|
|
339
|
+
```bash
|
|
340
|
+
export META_APP_ID=your_app_id
|
|
341
|
+
uvx meta-ads-mcp
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
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:
|
|
345
|
+
```bash
|
|
346
|
+
export META_ACCESS_TOKEN=your_access_token
|
|
347
|
+
uvx meta-ads-mcp
|
|
348
|
+
```
|
|
349
|
+
This is useful for CI/CD pipelines or when you already have a valid access token from another source.
|
|
411
350
|
|
|
412
351
|
## Testing
|
|
413
352
|
|
|
@@ -429,10 +368,9 @@ python test_meta_ads_auth.py --app-id YOUR_APP_ID --force-login
|
|
|
429
368
|
|
|
430
369
|
When using the Meta Ads MCP with an LLM interface (like Claude):
|
|
431
370
|
|
|
432
|
-
1.
|
|
433
|
-
2.
|
|
434
|
-
3.
|
|
435
|
-
4. Check specific account details with `mcp_meta_ads_get_account_info`
|
|
371
|
+
1. Test authentication by calling the `mcp_meta_ads_get_login_link` tool
|
|
372
|
+
2. Verify account access by calling `mcp_meta_ads_get_ad_accounts`
|
|
373
|
+
3. Check specific account details with `mcp_meta_ads_get_account_info`
|
|
436
374
|
|
|
437
375
|
These functions will automatically handle authentication if needed and provide a clickable login link if required.
|
|
438
376
|
|
|
@@ -443,20 +381,19 @@ These functions will automatically handle authentication if needed and provide a
|
|
|
443
381
|
If you encounter authentication issues:
|
|
444
382
|
|
|
445
383
|
1. When using the LLM interface:
|
|
446
|
-
-
|
|
447
|
-
- If using Pipeboard authentication (recommended), ensure the PIPEBOARD_API_TOKEN environment variable is set (token obtainable via https://pipeboard.co)
|
|
384
|
+
- Use the `mcp_meta_ads_get_login_link` tool to generate a fresh authentication link
|
|
448
385
|
- Ensure you click the link and complete the authorization flow in your browser
|
|
449
386
|
- Check that the callback server is running properly (the tool will report this)
|
|
450
387
|
|
|
451
|
-
2. When using
|
|
452
|
-
- Verify your `PIPEBOARD_API_TOKEN` is set correctly (token obtainable via https://pipeboard.co)
|
|
453
|
-
- Check if you need to complete the authorization process by visiting the provided login URL
|
|
454
|
-
- Try forcing a new login: `python test_pipeboard_auth.py --force-login`
|
|
455
|
-
|
|
456
|
-
3. When using direct Meta OAuth:
|
|
388
|
+
2. When using direct Meta OAuth:
|
|
457
389
|
- Run with `--force-login` to get a fresh token: `uvx meta-ads-mcp --login --app-id YOUR_APP_ID --force-login`
|
|
458
390
|
- Make sure the terminal has permissions to open a browser window
|
|
459
391
|
|
|
392
|
+
3. Skip authentication entirely by providing a token directly:
|
|
393
|
+
- If you already have a valid access token, you can bypass the authentication flow:
|
|
394
|
+
- `export META_ACCESS_TOKEN=your_access_token`
|
|
395
|
+
- This will ignore both the local token cache and the Pipeboard authentication
|
|
396
|
+
|
|
460
397
|
### API Errors
|
|
461
398
|
|
|
462
399
|
If you receive errors from the Meta API:
|