You need Node.js installed. It comes with npx built in.
npx "@opendirectory.dev/skills" install meta-ads-skill --target claudeSupported --target values: claude, gemini, codex, opencode, anti-gravity, openclaw, hermes
Run these two commands inside your Claude Code terminal:
# Add the OpenDirectory marketplace
/plugin marketplace add Varnan-Tech/opendirectory
# Install a skill directly
/plugin install meta-ads-skill@opendirectory-marketplaceStep 1: Download Click Code → Download ZIP on this repo's GitHub page.
Step 2: Install
- Open Claude Desktop > Customize > Skills > + > Upload a skill
- Drop the downloaded zip or extracted folder
The Meta Ads Skill is a comprehensive, production-ready OpenCode skill designed to give LLMs and AI agents expert-level capabilities to orchestrate the Varnan-Tech Meta Ads MCP Server.
By using this skill, an agent transforms into an Expert Media Buyer. It will know exactly how to safely authenticate, explore ad structures, troubleshoot campaign performance (like CPA spikes), discover new audiences, and format massive Meta APIs JSON payloads into beautiful, readable markdown reports.
This skill is designed using a Progressive Disclosure (Hub-and-Spoke) architecture to maximize context window efficiency:
- The Hub (
SKILL.md): The primary entry point. It provides strict guardrails, safety protocols, and the authentication troubleshooting workflow. - The Spokes (
references/&scripts/):- When you need to perform a specific task (e.g., investigating a CPA spike), read
references/workflows.mdfor the exact step-by-step orchestration strategy. - When presenting data to the user, read
references/report_templates.mdto strictly follow the required Markdown layout. - Data Parsing: Meta Ads JSON responses are massive. Always use the provided
scripts/formatters.pyto condense raw JSON fromget_campaigns,get_adsets, orget_insightsinto clean markdown tables before reasoning over them.
- When you need to perform a specific task (e.g., investigating a CPA spike), read
- Context Protection: ALWAYS default to
time_range="last_7d"for insights. ALWAYS uselimit=10for listing campaigns/adsets initially. - Safety First: NEVER execute state-changing tools (
create_campaign,update_campaign,clear_database,reset_database) without explicitly showing the parameters to the user and waiting for their affirmative confirmation.
To use this skill, the host machine must have the Varnan-Tech Meta Ads MCP Server installed and running.
- Python 3.10+
- A Meta Developer Account with a configured App.
- Go to the Facebook Developers Portal.
- Create an App and add the Marketing API product.
- Under the Facebook Login settings, add
http://localhost:8000/auth/facebook/callbackto the Valid OAuth Redirect URIs. - Retrieve your App ID and App Secret.
Clone the MCP repository:
git clone https://github.com/Varnan-Tech/Meta-Ads-MCP.git
cd Meta-Ads-MCP
pip install -r requirements.txtCreate a .env file in the root of the MCP server:
FB_APP_ID="your_facebook_app_id"
FB_APP_SECRET="your_facebook_app_secret"
FB_OAUTH_ENABLED="true"
FB_REDIRECT_URI="http://localhost:8000/auth/facebook/callback"
DATABASE_URL="sqlite:///.meta-ads-mcp/oauth.db"The server uses OAuth backed by a local SQLite database to seamlessly pass tokens to the MCP context.
- Start the local Auth Server:
python src/auth/run_web_server.py
- Authenticate: Open
http://localhost:8000/auth/facebookin your web browser. - Grant Permissions: Click "Connect Facebook" and approve the
ads_management,ads_read, andread_insightspermissions. - Completion: The OAuth token is saved securely to the SQLite DB. The agent can now use the MCP tools automatically without needing the token pasted into the prompt.
If an agent encounters an Auth Error during operation, it is instructed by this skill to guide the user back through this exact login flow.
When you deploy this skill, the structure will look like this:
meta-ads-skill/
SKILL.md # The core router & guardrails
references/
report_templates.md # Standardized markdown report structures
workflows.md # Orchestration strategies (e.g., CPA troubleshooting)
scripts/
auth_check.py # Diagnostic script for token status
formatters.py # JSON -> Markdown table utilities
Through the underlying MCP, this skill orchestrates:
- Account Management:
get_ad_accounts(),get_account_info() - Campaigns & Ads:
get_campaigns(),get_adsets(),get_ads(),create_campaign(),update_campaign() - Analytics:
get_insights(),analyze_campaigns() - Targeting:
search_interests(),search_demographics(),estimate_audience_size() - Database:
token_status(),clear_database(),reset_database()