Repository navigation
Expand file tree
/
Copy pathenv.example
More file actions
88 lines (72 loc) · 3.11 KB
/
Copy pathenv.example
File metadata and controls
88 lines (72 loc) · 3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Meta API Configuration (Required for basic functionality)
META_ACCESS_TOKEN=your_access_token_here
META_APP_ID=your_app_id
META_APP_SECRET=your_app_secret
# Default Ad Account (Optional)
DEFAULT_AD_ACCOUNT=act_123456789
# Environment Settings
ENVIRONMENT=development
LOG_LEVEL=INFO
# Rate Limiting (Optional)
MAX_REQUESTS_PER_HOUR=200
# API Timeout Settings (Optional)
# Meta's Insights API behavior:
# - Simple queries (campaigns, accounts): 5-15 seconds
# - Complex insights with breakdowns: 30-90 seconds
# - Very large accounts with 30+ day ranges: 90-180 seconds
# Setting to 180s ensures we handle worst-case scenarios
API_TIMEOUT_TOTAL=180 # Total request timeout in seconds (recommended: 180)
API_TIMEOUT_CONNECT=15 # Connection timeout in seconds (recommended: 15)
API_RETRY_COUNT=3 # Number of retries on failure
# Connection Pool Settings (Optional)
# Prevents connection exhaustion when handling multiple requests
CONNECTION_POOL_SIZE=100 # Maximum total connections
CONNECTION_POOL_PER_HOST=30 # Maximum connections per host
# Cache Settings (Optional)
CACHE_TTL=300
ENABLE_CACHE=true
# Token Storage Path (Optional)
TOKEN_STORAGE_PATH=~/.meta-ads-mcp/tokens.json
# ============================================
# Facebook OAuth Configuration (Required for OAuth)
# ============================================
# Set these when you have your Facebook App credentials from the client
FB_APP_ID=PLEASE_SET
FB_APP_SECRET=PLEASE_SET
FB_API_VERSION=v24.0
# OAuth Scopes (comma-separated)
# Required scopes for full Meta Ads access:
# - ads_management: Access and manage ad accounts (REQUIRED)
# - business_management: Access business-owned assets
# - pages_show_list: Access Facebook Pages
# - read_insights: Read ad performance metrics
# - public_profile: Basic user info
# Note: ads_management requires App Review for production, but works for admins/testers in Development mode
FB_OAUTH_SCOPES=ads_management,business_management,pages_show_list,read_insights,public_profile
# OAuth Redirect URI (must match Facebook App settings)
# In production, use your actual domain:
# FB_REDIRECT_URI=https://mcp.clientdomain.com/auth/facebook/callback
# For local development:
FB_REDIRECT_URI=http://localhost:8000/auth/facebook/callback
# Deauthorization Callback URL (for webhooks)
# In production, use your actual domain:
# FB_DEAUTH_CALLBACK=https://mcp.clientdomain.com/webhooks/facebook/deauth
# For local development:
FB_DEAUTH_CALLBACK=http://localhost:8000/webhooks/facebook/deauth
# Token Encryption
# In production, use a KMS key reference (e.g., AWS KMS, GCP KMS)
# For development, a local key is used (change in production!)
TOKEN_ENCRYPTION_KEY=
TOKEN_ENCRYPTION_KEY_LOCAL=dev-key-change-in-production
# OAuth Settings
FB_OAUTH_ENABLED=false # Set to 'true' when FB_APP_ID and FB_APP_SECRET are set
TOKEN_REFRESH_WINDOW_DAYS=10
OAUTH_STATE_TTL_MINUTES=10
# Database Configuration
# SQLite (default, for development)
DATABASE_URL=sqlite:///~/.meta-ads-mcp/oauth.db
# PostgreSQL (production example):
# DATABASE_URL=postgresql://user:password@localhost:5432/meta_ads_oauth
# Web Server Configuration
WEB_SERVER_HOST=0.0.0.0
WEB_SERVER_PORT=8000