meta-ads-mcp 0.3.8__tar.gz → 0.3.10__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.
Files changed (47) hide show
  1. meta_ads_mcp-0.3.10/LOCAL_INSTALLATION.md +489 -0
  2. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/PKG-INFO +102 -106
  3. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/README.md +98 -102
  4. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/RELEASE.md +1 -1
  5. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/STREAMABLE_HTTP_SETUP.md +7 -0
  6. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/meta_ads_mcp/__init__.py +1 -1
  7. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/meta_ads_mcp/core/__init__.py +1 -0
  8. meta_ads_mcp-0.3.10/meta_ads_mcp/core/reports.py +133 -0
  9. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/meta_ads_mcp/core/server.py +1 -1
  10. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/pyproject.toml +4 -4
  11. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/requirements.txt +1 -1
  12. meta_ads_mcp-0.3.10/tests/test_openai.py +23 -0
  13. meta_ads_mcp-0.3.8/debug/README.md +0 -40
  14. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/.github/workflows/publish.yml +0 -0
  15. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/.github/workflows/test.yml +0 -0
  16. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/.gitignore +0 -0
  17. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/CUSTOM_META_APP.md +0 -0
  18. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/Dockerfile +0 -0
  19. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/LICENSE +0 -0
  20. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/META_API_NOTES.md +0 -0
  21. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/examples/README.md +0 -0
  22. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/examples/example_http_client.py +0 -0
  23. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/future_improvements.md +0 -0
  24. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/images/meta-ads-example.png +0 -0
  25. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/meta_ads_auth.sh +0 -0
  26. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/meta_ads_mcp/__main__.py +0 -0
  27. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/meta_ads_mcp/core/accounts.py +0 -0
  28. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/meta_ads_mcp/core/ads.py +0 -0
  29. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/meta_ads_mcp/core/ads_library.py +0 -0
  30. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/meta_ads_mcp/core/adsets.py +0 -0
  31. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/meta_ads_mcp/core/api.py +0 -0
  32. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/meta_ads_mcp/core/auth.py +0 -0
  33. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/meta_ads_mcp/core/authentication.py +0 -0
  34. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/meta_ads_mcp/core/budget_schedules.py +0 -0
  35. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/meta_ads_mcp/core/callback_server.py +0 -0
  36. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/meta_ads_mcp/core/campaigns.py +0 -0
  37. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/meta_ads_mcp/core/http_auth_integration.py +0 -0
  38. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/meta_ads_mcp/core/insights.py +0 -0
  39. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/meta_ads_mcp/core/pipeboard_auth.py +0 -0
  40. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/meta_ads_mcp/core/resources.py +0 -0
  41. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/meta_ads_mcp/core/utils.py +0 -0
  42. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/setup.py +0 -0
  43. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/smithery.yaml +0 -0
  44. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/tests/README.md +0 -0
  45. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/tests/__init__.py +0 -0
  46. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/tests/conftest.py +0 -0
  47. {meta_ads_mcp-0.3.8 → meta_ads_mcp-0.3.10}/tests/test_http_transport.py +0 -0
@@ -0,0 +1,489 @@
1
+ # Meta Ads MCP - Local Installation Guide
2
+
3
+ This guide covers everything you need to know about installing and running Meta Ads MCP locally on your machine. For the easier Remote MCP option, **[🚀 get started here](https://pipeboard.co)**.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Prerequisites](#prerequisites)
8
+ - [Installation Methods](#installation-methods)
9
+ - [Authentication Setup](#authentication-setup)
10
+ - [MCP Client Configuration](#mcp-client-configuration)
11
+ - [Development Installation](#development-installation)
12
+ - [Privacy and Security](#privacy-and-security)
13
+ - [Testing and Verification](#testing-and-verification)
14
+ - [Debugging and Logs](#debugging-and-logs)
15
+ - [Troubleshooting](#troubleshooting)
16
+ - [Advanced Configuration](#advanced-configuration)
17
+
18
+ ## Prerequisites
19
+
20
+ - **Python 3.8 or higher**
21
+ - **[uv](https://docs.astral.sh/uv/) package manager** (recommended) or pip
22
+ - **Meta Ads account** with appropriate permissions
23
+ - **MCP-compatible client** (Claude Desktop, Cursor, Cherry Studio, etc.)
24
+
25
+ ## Installation Methods
26
+
27
+ ### Method 1: Using uvx (Recommended)
28
+
29
+ ```bash
30
+ # Install via uvx (automatically handles dependencies)
31
+ uvx meta-ads-mcp
32
+ ```
33
+
34
+ ### Method 2: Using pip
35
+
36
+ ```bash
37
+ # Install via pip
38
+ pip install meta-ads-mcp
39
+ ```
40
+
41
+ ### Method 3: Development Installation
42
+
43
+ ```bash
44
+ # Clone the repository
45
+ git clone https://github.com/pipeboard-co/meta-ads-mcp.git
46
+ cd meta-ads-mcp
47
+
48
+ # Install in development mode
49
+ uv pip install -e .
50
+ # Or with pip
51
+ pip install -e .
52
+ ```
53
+
54
+ ## Authentication Setup
55
+
56
+ You have two authentication options:
57
+
58
+ ### Option 1: Pipeboard Authentication (Recommended)
59
+
60
+ This is the easiest method that handles all OAuth complexity for you:
61
+
62
+ 1. **Sign up to Pipeboard**
63
+ - Visit [Pipeboard.co](https://pipeboard.co)
64
+ - Create an account
65
+
66
+ 2. **Generate API Token**
67
+ - Go to [pipeboard.co/api-tokens](https://pipeboard.co/api-tokens)
68
+ - Generate a new API token
69
+ - Copy the token securely
70
+
71
+ 3. **Set Environment Variable**
72
+ ```bash
73
+ # On macOS/Linux
74
+ export PIPEBOARD_API_TOKEN=your_pipeboard_token_here
75
+
76
+ # On Windows (Command Prompt)
77
+ set PIPEBOARD_API_TOKEN=your_pipeboard_token_here
78
+
79
+ # On Windows (PowerShell)
80
+ $env:PIPEBOARD_API_TOKEN="your_pipeboard_token_here"
81
+ ```
82
+
83
+ 4. **Make it Persistent**
84
+
85
+ Add to your shell profile (`.bashrc`, `.zshrc`, etc.):
86
+ ```bash
87
+ echo 'export PIPEBOARD_API_TOKEN=your_pipeboard_token_here' >> ~/.bashrc
88
+ source ~/.bashrc
89
+ ```
90
+
91
+ ### Option 2: Custom Meta App
92
+
93
+ If you prefer to use your own Meta Developer App, see [CUSTOM_META_APP.md](CUSTOM_META_APP.md) for detailed instructions.
94
+
95
+ ## MCP Client Configuration
96
+
97
+ ### Claude Desktop
98
+
99
+ Add to your `claude_desktop_config.json`:
100
+
101
+ **Location:**
102
+ - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
103
+ - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
104
+
105
+ **Configuration:**
106
+ ```json
107
+ {
108
+ "mcpServers": {
109
+ "meta-ads": {
110
+ "command": "uvx",
111
+ "args": ["meta-ads-mcp"],
112
+ "env": {
113
+ "PIPEBOARD_API_TOKEN": "your_pipeboard_token"
114
+ }
115
+ }
116
+ }
117
+ }
118
+ ```
119
+
120
+ ### Cursor
121
+
122
+ Add to your `~/.cursor/mcp.json`:
123
+
124
+ ```json
125
+ {
126
+ "mcpServers": {
127
+ "meta-ads": {
128
+ "command": "uvx",
129
+ "args": ["meta-ads-mcp"],
130
+ "env": {
131
+ "PIPEBOARD_API_TOKEN": "your_pipeboard_token"
132
+ }
133
+ }
134
+ }
135
+ }
136
+ ```
137
+
138
+ ### Cherry Studio
139
+
140
+ In Cherry Studio settings, add a new MCP server:
141
+ - **Name**: Meta Ads MCP
142
+ - **Command**: `uvx`
143
+ - **Arguments**: `["meta-ads-mcp"]`
144
+ - **Environment Variables**: `PIPEBOARD_API_TOKEN=your_pipeboard_token`
145
+
146
+ ## Development Installation
147
+
148
+ ### Setting Up Development Environment
149
+
150
+ ```bash
151
+ # Clone the repository
152
+ git clone https://github.com/pipeboard-co/meta-ads-mcp.git
153
+ cd meta-ads-mcp
154
+
155
+ # Create virtual environment (optional but recommended)
156
+ python -m venv venv
157
+ source venv/bin/activate # On Windows: venv\Scripts\activate
158
+
159
+ # Install in development mode with dependencies
160
+ uv pip install -e .
161
+
162
+ # Install development dependencies
163
+ uv pip install -e ".[dev]" # If dev dependencies are defined
164
+ ```
165
+
166
+ ### Running from Source
167
+
168
+ ```bash
169
+ # Set environment variable
170
+ export PIPEBOARD_API_TOKEN=your_token
171
+
172
+ # Run directly
173
+ python -m meta_ads_mcp
174
+
175
+ # Or if installed in development mode
176
+ meta-ads-mcp
177
+ ```
178
+
179
+ ### Testing Your Installation
180
+
181
+ ```bash
182
+ # Test the installation
183
+ python -c "import meta_ads_mcp; print('Installation successful!')"
184
+
185
+ # Test MCP server startup
186
+ meta-ads-mcp --help
187
+ ```
188
+
189
+ ## Privacy and Security
190
+
191
+ ### Token Storage and Caching
192
+
193
+ Meta Ads MCP follows security best practices:
194
+
195
+ 1. **Secure Token Cache Location**:
196
+ - **Windows**: `%APPDATA%\meta-ads-mcp\token_cache.json`
197
+ - **macOS**: `~/Library/Application Support/meta-ads-mcp/token_cache.json`
198
+ - **Linux**: `~/.config/meta-ads-mcp/token_cache.json`
199
+
200
+ 2. **Automatic Token Management**:
201
+ - Tokens are cached securely after first authentication
202
+ - You don't need to provide access tokens for each command
203
+ - Tokens are automatically refreshed when needed
204
+
205
+ 3. **Environment Variable Security**:
206
+ - `PIPEBOARD_API_TOKEN` should be kept secure
207
+ - Don't commit tokens to version control
208
+ - Use environment files (`.env`) for local development
209
+
210
+ ### Security Best Practices
211
+
212
+ ```bash
213
+ # Create a .env file for local development (never commit this)
214
+ echo "PIPEBOARD_API_TOKEN=your_token_here" > .env
215
+
216
+ # Add .env to .gitignore
217
+ echo ".env" >> .gitignore
218
+
219
+ # Load environment variables from .env
220
+ source .env
221
+ ```
222
+
223
+ ## Testing and Verification
224
+
225
+ ### Basic Functionality Test
226
+
227
+ Once installed and configured, test with your MCP client:
228
+
229
+ 1. **Verify Account Access**
230
+ ```
231
+ Ask your LLM: "Use mcp_meta_ads_get_ad_accounts to show my Meta ad accounts"
232
+ ```
233
+
234
+ 2. **Check Account Details**
235
+ ```
236
+ Ask your LLM: "Get details for account act_XXXXXXXXX using mcp_meta_ads_get_account_info"
237
+ ```
238
+
239
+ 3. **List Campaigns**
240
+ ```
241
+ Ask your LLM: "Show me my active campaigns using mcp_meta_ads_get_campaigns"
242
+ ```
243
+
244
+ ### Manual Testing with Python
245
+
246
+ ```python
247
+ # Test authentication
248
+ from meta_ads_mcp.core.auth import get_access_token
249
+
250
+ try:
251
+ token = get_access_token()
252
+ print("Authentication successful!")
253
+ print(f"Token starts with: {token[:10]}...")
254
+ except Exception as e:
255
+ print(f"Authentication failed: {e}")
256
+ ```
257
+
258
+ ### Testing with MCP Client
259
+
260
+ When using Meta Ads MCP with an LLM interface:
261
+
262
+ 1. Ensure the `PIPEBOARD_API_TOKEN` environment variable is set
263
+ 2. Verify account access by calling `mcp_meta_ads_get_ad_accounts`
264
+ 3. Check specific account details with `mcp_meta_ads_get_account_info`
265
+ 4. Test campaign retrieval with `mcp_meta_ads_get_campaigns`
266
+
267
+ ## Debugging and Logs
268
+
269
+ ### Log File Locations
270
+
271
+ Debug logs are automatically created in platform-specific locations:
272
+
273
+ - **macOS**: `~/Library/Application\ Support/meta-ads-mcp/meta_ads_debug.log`
274
+ - **Windows**: `%APPDATA%\meta-ads-mcp\meta_ads_debug.log`
275
+ - **Linux**: `~/.config/meta-ads-mcp/meta_ads_debug.log`
276
+
277
+ ### Enabling Debug Mode
278
+
279
+ ```bash
280
+ # Set debug environment variable
281
+ export META_ADS_DEBUG=true
282
+
283
+ # Run with verbose output
284
+ meta-ads-mcp --verbose
285
+ ```
286
+
287
+ ### Viewing Logs
288
+
289
+ ```bash
290
+ # On macOS/Linux
291
+ tail -f ~/Library/Application\ Support/meta-ads-mcp/meta_ads_debug.log
292
+
293
+ # On Windows
294
+ type %APPDATA%\meta-ads-mcp\meta_ads_debug.log
295
+ ```
296
+
297
+ ### Common Debug Commands
298
+
299
+ ```bash
300
+ # Check if MCP server starts correctly
301
+ meta-ads-mcp --test-connection
302
+
303
+ # Verify environment variables
304
+ echo $PIPEBOARD_API_TOKEN
305
+
306
+ # Test Pipeboard authentication
307
+ python -c "
308
+ from meta_ads_mcp.core.pipeboard_auth import test_auth
309
+ test_auth()
310
+ "
311
+ ```
312
+
313
+ ## Troubleshooting
314
+
315
+ ### Authentication Issues
316
+
317
+ #### Problem: "PIPEBOARD_API_TOKEN not set"
318
+ ```bash
319
+ # Solution: Set the environment variable
320
+ export PIPEBOARD_API_TOKEN=your_token_here
321
+
322
+ # Verify it's set
323
+ echo $PIPEBOARD_API_TOKEN
324
+ ```
325
+
326
+ #### Problem: "Invalid Pipeboard token"
327
+ 1. Check your token at [pipeboard.co/api-tokens](https://pipeboard.co/api-tokens)
328
+ 2. Regenerate if necessary
329
+ 3. Update your environment variable
330
+
331
+ #### Problem: "Authentication failed"
332
+ ```bash
333
+ # Clear cached tokens and retry
334
+ rm -rf ~/.config/meta-ads-mcp/token_cache.json # Linux
335
+ rm -rf ~/Library/Application\ Support/meta-ads-mcp/token_cache.json # macOS
336
+
337
+ # Force re-authentication
338
+ python test_pipeboard_auth.py --force-login
339
+ ```
340
+
341
+ ### Installation Issues
342
+
343
+ #### Problem: "Command not found: uvx"
344
+ ```bash
345
+ # Install uv first
346
+ curl -LsSf https://astral.sh/uv/install.sh | sh
347
+
348
+ # Or use pip
349
+ pip install meta-ads-mcp
350
+ ```
351
+
352
+ #### Problem: "Permission denied"
353
+ ```bash
354
+ # Use user installation
355
+ pip install --user meta-ads-mcp
356
+
357
+ # Or use virtual environment
358
+ python -m venv venv
359
+ source venv/bin/activate
360
+ pip install meta-ads-mcp
361
+ ```
362
+
363
+ #### Problem: "Python version incompatible"
364
+ ```bash
365
+ # Check Python version
366
+ python --version
367
+
368
+ # Update to Python 3.8+
369
+ # Use pyenv or your system's package manager
370
+ ```
371
+
372
+ ### Runtime Issues
373
+
374
+ #### Problem: "Failed to connect to Meta API"
375
+ 1. Check internet connection
376
+ 2. Verify Meta API status
377
+ 3. Check rate limits
378
+ 4. Ensure account permissions
379
+
380
+ #### Problem: "MCP client can't find server"
381
+ 1. Verify the command path in your MCP client config
382
+ 2. Check environment variables are set in the client
383
+ 3. Test the command manually in terminal
384
+
385
+ #### Problem: "SSL/TLS errors"
386
+ ```bash
387
+ # Update certificates
388
+ pip install --upgrade certifi
389
+
390
+ # Or use system certificates
391
+ export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
392
+ ```
393
+
394
+ ### API Errors
395
+
396
+ #### Problem: "Insufficient permissions"
397
+ - Ensure your Meta account has access to the ad accounts
398
+ - Check if your Pipeboard token has the right scopes
399
+ - Verify account roles in Meta Business Manager
400
+
401
+ #### Problem: "Rate limit exceeded"
402
+ - Wait before retrying
403
+ - Reduce request frequency
404
+ - Check if multiple instances are running
405
+
406
+ #### Problem: "Account not found"
407
+ - Verify account ID format (should be `act_XXXXXXXXX`)
408
+ - Check account access permissions
409
+ - Ensure account is active
410
+
411
+ ### Performance Issues
412
+
413
+ #### Problem: "Slow response times"
414
+ ```bash
415
+ # Check network latency
416
+ ping graph.facebook.com
417
+
418
+ # Clear cache
419
+ rm -rf ~/.config/meta-ads-mcp/token_cache.json
420
+
421
+ # Check system resources
422
+ top # or htop on Linux/macOS
423
+ ```
424
+
425
+ ## Advanced Configuration
426
+
427
+ ### Custom Configuration File
428
+
429
+ Create `~/.config/meta-ads-mcp/config.json`:
430
+
431
+ ```json
432
+ {
433
+ "api_version": "v21.0",
434
+ "timeout": 30,
435
+ "max_retries": 3,
436
+ "debug": false,
437
+ "cache_duration": 3600
438
+ }
439
+ ```
440
+
441
+ ### Environment Variables
442
+
443
+ ```bash
444
+ # API Configuration
445
+ export META_API_VERSION=v21.0
446
+ export META_API_TIMEOUT=30
447
+ export META_ADS_DEBUG=true
448
+
449
+ # Cache Configuration
450
+ export META_ADS_CACHE_DIR=/custom/cache/path
451
+ export META_ADS_CACHE_DURATION=3600
452
+
453
+ # Pipeboard Configuration
454
+ export PIPEBOARD_API_BASE=https://api.pipeboard.co
455
+ export PIPEBOARD_API_TOKEN=your_token_here
456
+ ```
457
+
458
+ ### Transport Configuration
459
+
460
+ Meta Ads MCP uses **stdio transport** by default. For HTTP transport:
461
+
462
+ See [STREAMABLE_HTTP_SETUP.md](STREAMABLE_HTTP_SETUP.md) for streamable HTTP transport configuration.
463
+
464
+ ### Custom Meta App Integration
465
+
466
+ For advanced users who want to use their own Meta Developer App:
467
+
468
+ 1. Follow [CUSTOM_META_APP.md](CUSTOM_META_APP.md) guide
469
+ 2. Set up OAuth flow
470
+ 3. Configure environment variables:
471
+ ```bash
472
+ export META_APP_ID=your_app_id
473
+ export META_APP_SECRET=your_app_secret
474
+ export META_REDIRECT_URI=your_redirect_uri
475
+ ```
476
+
477
+ ## Getting Help
478
+
479
+ If you're still experiencing issues:
480
+
481
+ 1. **Check the logs** for detailed error messages
482
+ 2. **Search existing issues** on GitHub
483
+ 3. **Join our Discord** at [discord.gg/hNxpJcqM52](https://discord.gg/hNxpJcqM52)
484
+ 4. **Email support** at info@pipeboard.co
485
+ 5. **Consider Remote MCP** at [pipeboard.co](https://pipeboard.co) as an alternative
486
+
487
+ ---
488
+
489
+ **Quick Alternative**: If local installation is causing issues, try our [Remote MCP service](https://pipeboard.co) - no local setup required!