Tutorial

How to Attach Meta Ads MCP to Claude Code (Terminal)

An r/ClaudeCode post asked how to wire Meta Ads MCP into Claude Code in the terminal. Walk-through with Scavio for competitor SERP context.

An r/ClaudeCode thread asked how to wire Meta Ads MCP into Claude Code (terminal) — most tutorials show the claude.ai connector path only. This walks the CLI path, plus Scavio for live competitor SERP context.

Prerequisites

  • Claude Code CLI
  • Meta Business account with ads_management scope access
  • Scavio API key
  • (Optional) Google Ads MCP

Walkthrough

Step 1: Find a maintained Meta Ads MCP repo

Several exist; pick by recent commits + scope.

Bash
# Search GitHub for 'meta-ads-mcp' or 'facebook-ads-mcp'. Verify:
# - active commits in the last 90 days
# - explicit scope handling
# - reasonable license

Step 2: Install per the repo's README and run the auth flow

OAuth or token in env var.

Bash
export META_ACCESS_TOKEN=...
claude mcp add meta-ads <node-or-python-cmd-from-repo>

Step 3: Add Scavio MCP for competitor SERP context

Live ad-copy and competitor signal.

Bash
claude mcp add scavio https://mcp.scavio.dev/mcp --header 'x-api-key: $SCAVIO_API_KEY'

Step 4: Set routing rules in Claude Code system prompt

Each MCP has a clear job.

Text
// 'For account/campaign/ad performance lookups, call meta-ads. For competitor ad copy, recent SERP for keywords, or Reddit signal on ad creative, call scavio.'

Step 5: Run a daily ad-account audit

End-to-end pattern.

Text
// 'Pull the last 7 days of campaign performance from meta-ads. For each underperforming campaign, run scavio competitor SERP for the campaign keyword. Suggest 3 creative variations.'

Step 6: OAuth scope warning

Read scopes before approval.

Text
// 'ads_management' lets the agent edit/spend. Use a sandbox account first; gate edits behind explicit user confirmation.

Python Example

Python
# Per-account-month: 50 reports + 30 competitor SERP = ~80 calls × $0.0043 = $0.34.

JavaScript Example

JavaScript
// CLI MCP setup; no JS application code.

Expected Output

JSON
Claude Code (terminal) with Meta Ads MCP attached + Scavio for competitor SERP context. Daily ad audits + creative suggestions in one session.

Related Tutorials

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

Claude Code CLI. Meta Business account with ads_management scope access. Scavio API key. (Optional) Google Ads MCP. A Scavio API key gives you 500 free credits per month.

Yes. The free tier includes 500 credits per month, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Start Building

An r/ClaudeCode post asked how to wire Meta Ads MCP into Claude Code in the terminal. Walk-through with Scavio for competitor SERP context.