/meta-ads-analytics:meta-ads-setupfrom meta-ads-analytics
Set up and configure the Meta Ads Analytics plugin. Use when the user says "set up meta ads", "configure meta ads", "connect my ad account", "I need to set up my Meta token", or when the SessionStart hook detects missing credentials. Handles Python installation, dependency setup, and Meta Developer Portal credential configuration.
Ships in meta-ads-analytics. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Guide the user through setting up the Meta Ads Analytics plugin. This user may not be technical, so keep instructions simple and visual.
Run this check:
python3.12 --version 2>/dev/null || python3.11 --version 2>/dev/null || python3 --version 2>/dev/null
If Python 3.11+ is available, skip to Step 2.
If not, check the platform and install:
macOS:
/opt/homebrew/bin/brew install [email protected] 2>/dev/null || /usr/local/bin/brew install [email protected] 2>/dev/null
If Homebrew is not found, tell the user:
I need to install Python 3.12 but Homebrew isn't available. Please open Terminal and paste this command, then let me try again:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Check if the venv exists:
test -f "${CLAUDE_PLUGIN_ROOT}/servers/.venv/bin/python" && echo "exists" || echo "missing"
If missing, create it:
cd "${CLAUDE_PLUGIN_ROOT}/servers" && python3.12 -m venv .venv && .venv/bin/pip install -r "${CLAUDE_PLUGIN_ROOT}/requirements.txt"
Tell the user: "Installing the required Python packages — this takes about a minute."
Check if .env exists with real values:
if [ -f "${CLAUDE_PLUGIN_ROOT}/.env" ]; then
grep -q "your_access_token_here\|your_ad_account_id_here\|^$" "${CLAUDE_PLUGIN_ROOT}/.env" && echo "needs_config" || echo "configured"
else
echo "no_env"
fi
If credentials are missing, walk the user through setup. Reference references/meta-setup-guide.md for detailed instructions. Present it conversationally:
Ad Account ID: Ask the user to open Meta Ads Manager (adsmanager.facebook.com). The URL contains their account ID — it looks like act=123456789 in the address bar. They need to give you that number.
Meta App: Ask if they have a Meta Developer app already. If not, guide them to developers.facebook.com/apps to create one:
Access Token: Guide them to the Graph API Explorer (developers.facebook.com/tools/explorer):
ads_read permission when promptedSave credentials: Write the .env file:
cat > "${CLAUDE_PLUGIN_ROOT}/.env" << 'EOF'
META_ACCESS_TOKEN=THEIR_TOKEN_HERE
META_AD_ACCOUNT_ID=act_THEIR_ID_HERE
EOF
Replace the placeholder values with what the user provided.
Run a quick test:
curl -s -G "https://graph.facebook.com/v21.0/ACCOUNT_ID" \
-d "fields=name,account_status" \
-d "access_token=TOKEN" | python3 -m json.tool
Replace ACCOUNT_ID and TOKEN with the values from .env.
If successful, tell the user: "You're all set! Your Meta Ads account is connected. You can now ask me things like 'how are my campaigns doing?' or 'which campaigns should I cut spend on?'"
If it fails, check the error and guide them:
act_ prefix)Mention that the token from Step 3 expires in about 1-2 hours. For a longer-lasting token (60 days), they can exchange it:
curl -s -G "https://graph.facebook.com/v21.0/oauth/access_token" \
-d "grant_type=fb_exchange_token" \
-d "client_id=APP_ID" \
-d "client_secret=APP_SECRET" \
-d "fb_exchange_token=SHORT_TOKEN"
They'll find their App ID and App Secret in the Meta App Dashboard under Settings > Basic.
For a token that never expires, they can create a System User in Business Manager — but this is optional and can be done later.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub asadq287/meta-ads-analytics --plugin meta-ads-analytics