Run Google Ads and Meta Campaigns from Claude Code: The Complete Setup
Adspirer Team
This is the hands-on guide for running Google Ads and Meta campaigns from Claude Code. You’ll install the Adspirer plugin (one command), create your brand workspace with CLAUDE.md and STRATEGY.md, understand the 5 ad management skills, configure explicit safety rules, and run your first autonomous performance audit across both platforms. Setup takes about 10 minutes. What you get is a fully agentic workflow — scheduled audits, automated waste detection, multi-step campaign builds — all driven by Claude Code calling Adspirer’s 200+ advertising tools.
If you’ve used Claude Code for software development, you already know how it operates: it reads files, runs commands, takes multi-step actions, and can be scheduled to work unsupervised. This guide applies that same capability to paid media management — specifically Google Ads and Meta Ads.
Adspirer is a hosted MCP server that gives Claude Code access to 200+ advertising tools spanning Google Ads, Meta Ads, LinkedIn Ads, and TikTok Ads. When you connect the two, Claude Code becomes a fully autonomous ad agent. It can run a weekly performance audit every Monday morning without you opening a dashboard, find wasted spend on demand, and build complete campaigns from a one-paragraph brief — all from your terminal.
This guide focuses on the Google Ads + Meta Ads workflow. It’s more setup than connecting ChatGPT to the Adspirer plugin — but it’s meaningfully more powerful for automation. You define the rules once; Claude Code executes them on a schedule.
This guide is part of the Claude Code agent setup series.
- How to Build an AI Marketing Agent for Paid Media — The concept and why it matters
- How to Set Up Your AI Marketing Agent with Claude Code — Full agent architecture, sub-agents, memory system
- How to Set Up Your AI Marketing Agent with Codex — The OpenAI Codex equivalent
- This post: Running Google Ads and Meta campaigns from Claude Code CLI
Prerequisites
Before starting, make sure you have all four of the following:
- Claude Code CLI installed and working (
npm i -g @anthropic-ai/claude-code, requires Node.js 18+). See the Claude Code installation guide. - Claude Pro, Max, Team, or Enterprise subscription — Claude Code requires an Anthropic paid plan.
- Adspirer account with at least one ad account connected. Create a free account →
- Google Ads and/or Meta Ads account connected inside Adspirer. You’ll do this during Step 2.
You can use this guide with Google Ads only, Meta Ads only, or both connected simultaneously. The cross-platform comparison features require at least one account on each platform.
Step 1: Install the Adspirer Plugin
Open Claude Code and type this directly into the input bar (not as a prompt to the AI):
/plugin install adspirer-ads-agentOr browse for it: type /plugin, switch to the Discover tab, search for “Ads”, and select adspirer-ads-agent from claude-plugins-official.
After installation, reload plugins to activate:
/reload-pluginsThis single install sets up everything needed to manage ads from Claude Code:
| Component | Location | Purpose |
|---|---|---|
| MCP Server | Plugin config | Connects Claude Code to Adspirer’s 200+ advertising tools via OAuth 2.1 |
| Sub-Agent | ~/.claude/agents/performance-marketing-agent.md | Defines the agent’s behavior, brand context loading, and workflow patterns |
| Skill | ~/.claude/skills/ad-campaign-management/SKILL.md | Proven tool sequences for each task type across all platforms |
| 5 Slash Commands | ~/.claude/commands/*.md | Quick-access commands for setup, performance review, waste audit, copy writing, and refresh |
The /plugin and /reload-plugins commands must be typed directly into Claude Code’s input bar — they are user commands, not prompts for the AI. If you ask the AI to run them, you’ll get a “nested session” error.
Step 2: Connect Your Ad Accounts
After installing the plugin, authenticate with Adspirer. Type in the Claude Code input bar:
/mcpFind plugin:adspirer-ads-agent:adspirer MCP Server in the list and select Authenticate. A browser window opens where you:
- Sign in to your Adspirer account (or create one)
- Connect your Google Ads account via OAuth
- Connect your Meta Ads account via OAuth
Both connections use OAuth 2.1 with PKCE. Your ad credentials are never stored locally — Adspirer handles all platform authentication server-side. You can revoke access anytime from your Adspirer dashboard. See the security documentation for the full security model.
After authenticating, run /mcp again to verify. The Adspirer server should show as connected with tools listed.
Step 3: Create Your Brand Workspace
Navigate to the folder where you keep your brand’s marketing files, then launch Claude Code:
cd ~/Clients/YourBrand # wherever your brand docs liveclaudeRun the setup command:
/adspirer:setupWhat Happens During Setup
Scans Your Local Files
The agent reads brand documents in your folder — .md, .txt, .csv, .pdf, .yaml, .json files. Brand guidelines, media plans, audience research, competitor notes — anything it finds gets absorbed into the brand context. Drop your brand docs into the folder before running setup. The more context you give it, the more relevant every future recommendation will be.
Pulls Your Ad Account Data
Calls Adspirer’s get_connections_status tool to confirm which platforms are live, then pulls account-level metadata for Google Ads and Meta Ads — account names, IDs, active campaign counts, and current status.
Pulls 30-Day Performance Baseline
Pulls the last 30 days of campaign performance across all connected platforms. This baseline is what the agent uses for anomaly detection, KPI comparisons, and future trend analysis.
Creates CLAUDE.md
Builds the brand context file — brand overview, target audiences, voice guidelines, connected platforms, budget guardrails, KPI targets, performance snapshot, and key findings from the initial data pull. Claude Code reads this file automatically at the start of every session.
Creates STRATEGY.md
Initializes the strategy playbook. Starts nearly empty but fills over time with confirmed strategic directives: AVOID/PREFER/CONSTRAINT rules per platform — for example, “AVOID broad match on branded Google Ads campaigns” or “PREFER Reels placements on Meta for prospecting audiences.” Directives are only written to this file after your explicit confirmation.
Your Workspace After Setup
~/Clients/YourBrand/├── CLAUDE.md # Brand context — loaded automatically every session├── STRATEGY.md # Strategy directives — updated only with your approval├── brand-guidelines.pdf # Your existing docs└── media-plan.csv # Your existing docsWhat a Real CLAUDE.md Contains
Here’s an abbreviated example of what the agent creates for a SaaS brand:
# AGENTS.md — CloudBase Brand Context
## Brand OverviewCloudBase sells B2B project management software for engineering teams.Industry: SaaS / Productivity. Primary market: US, Canada, UK.
## KPI Targets- Google Ads Search: Target CPA $80, Target ROAS 4.0x- Meta Ads Prospecting: Target CPL $35, Frequency cap: 3.0- Meta Ads Retargeting: Target ROAS 6.0x, Max CPM $18
## Budget Guardrails- Monthly Google Ads budget: $12,000 (never exceed without approval)- Monthly Meta Ads budget: $8,000 (never exceed without approval)- Single campaign daily budget cap: $500
## Connected Platforms- Google Ads: Account 123-456-7890 (12 active campaigns)- Meta Ads: Account 9876543210 (8 active ad sets)
## Performance Snapshot (Last 30 Days)- Google Ads: 847 conversions, avg CPA $74, ROAS 4.3x- Meta Ads: 312 leads, avg CPL $41, top creative: Video-ProductDemo-v3
## Brand VoiceProfessional but approachable. No jargon. Short sentences. Never use"leverage", "synergy", or "game-changer". Approved CTA: "Start free trial".
## Safety Rules- All new campaigns created PAUSED — never enable without human approval- Budget changes above 20% require explicit human confirmation- Never modify campaigns that have converted in the last 7 days without reviewWhat a Real STRATEGY.md Contains
# STRATEGY.md — CloudBase Ad Strategy
## Google Ads Directives- AVOID: broad match on branded keywords (causes brand cannibalization)- PREFER: exact + phrase match for high-intent keywords- CONSTRAINT: max CPC $4.00 on non-branded search terms
## Meta Ads Directives- PREFER: Advantage+ audience over manual interests for prospecting- AVOID: static image creatives in prospecting (video outperforms 2.4x)- CONSTRAINT: pause any ad set with frequency > 3.0 within 7 days
## Cross-Platform- Attribution model: Data-driven (Google), 7-day click / 1-day view (Meta)- Report comparison window: same 30-day period, not rollingStep 4: The 5 Ad Management Skills
Your agent has 5 skills covering every ad management workflow. You don’t need to memorize slash commands — describe what you need in plain language and the agent matches the right workflow. But knowing the commands makes you faster when you know exactly what you want.
| Skill | Slash Command | What It Does |
|---|---|---|
| Setup | /adspirer:setup | Bootstraps brand workspace, creates CLAUDE.md and STRATEGY.md, pulls account data |
| Performance Review | /adspirer:performance-review | Cross-platform scorecard against your KPI targets, anomaly detection, strategy drift check |
| Wasted Spend | /adspirer:wasted-spend | Finds keywords spending without converting, creatives with declining CTR, audiences with poor ROI |
| Ad Copy | /adspirer:write-ad-copy | Brand-voice ad copy using your CLAUDE.md guidelines and real performance data |
| Refresh | /adspirer:refresh-brand-context | Re-scans folder for new brand docs, pulls latest performance, updates CLAUDE.md |
Step 5: Configure Safety Rules
This is the most important section of this guide. When Claude Code manages live ad spend autonomously, the safety rules you define in CLAUDE.md are your protection layer. They are not suggestions — they are constraints the agent enforces before taking any action.
Add this safety block to your CLAUDE.md before you run any write operations:
## Safety Rules (Non-Negotiable)
### What the Agent MUST NEVER Do Without Explicit Human Approval- Enable any campaign from PAUSED to ENABLED status- Increase any campaign's daily or monthly budget- Change any campaign's bidding strategy- Modify a campaign that has converted in the last 7 days- Create campaigns on platforms not listed in Connected Platforms above
### What the Agent Can Do Autonomously (Read Operations)- Pull performance data from any connected platform- Generate reports, audits, and recommendations- Identify wasted spend candidates- Research keywords and audience segments- Generate ad copy drafts
### Spending Caps — Hard Limits- No single campaign may have a daily budget above $500 without approval- No monthly platform budget may exceed the amounts in KPI Targets above- Any budget increase recommendation above 20% of current spend requires human sign-off
### Campaign Creation Rules- All new campaigns created with status: PAUSED- Include a summary of all campaigns created in the same response- Flag any campaign where estimated CPC exceeds the CPA target by 3xNever enable Claude Code’s “Full Access” mode for ad management workflows. Full Access auto-approves all tool calls including write operations. For advertising, always use Auto mode — read operations run automatically, write operations (creating campaigns, changing budgets, modifying targeting) require your explicit approval before executing. The whole value of the safety model is that the agent surfaces the recommendation and you make the final call on spend.
Claude Code’s Built-In Permission Layer
Beyond your CLAUDE.md safety rules, Claude Code enforces a second layer through its approval modes:
| Mode | Tool Calls | Right For |
|---|---|---|
| Default | Each requires approval | First-time setup and learning the system |
| Auto (recommended) | Read ops auto-approved, write ops prompt you | Day-to-day ad management |
| Full Access | All auto-approved | Never use for ad management |
In Auto mode, when the agent tries to create a campaign, Claude Code surfaces the exact API call it’s about to make and waits for you to approve or reject. This is not a speed bottleneck — it’s the natural check that experienced media buyers would want before any spend commitment.
Step 6: Run Your First Performance Audit
With installation, authentication, brand workspace, and safety rules in place, run your first audit:
What Claude Code Does
After you send that prompt, Claude Code executes this sequence automatically:
Reads Your Brand Context
Loads CLAUDE.md (KPI targets, budget guardrails, brand rules), STRATEGY.md (active directives and constraints).
Verifies Platform Connections
Calls get_connections_status to confirm Google Ads and Meta Ads are active and pulls account-level metadata.
Pulls Google Ads Data
Calls Adspirer tools for campaign metrics, ad group performance, keyword data, search term report, and Quality Score indicators for the 30-day window.
Pulls Meta Ads Data
Calls Adspirer tools for campaign and ad set metrics, creative-level performance, audience segment data, frequency by ad set, and delivery insights.
Cross-References Against Targets
Compares actual CPA, ROAS, CPL, and frequency against your CLAUDE.md targets. Checks STRATEGY.md for any campaigns violating your directives — for example, a broad match keyword running on a branded campaign you explicitly prohibited.
Returns Structured Report
Delivers a prioritized action list — metrics by platform, anomalies flagged with explanations, strategy drift identified, and specific recommended actions ordered by estimated impact.
What the Output Looks Like
The agent returns a structured report covering:
- Platform scorecards — campaign-by-campaign comparison against your KPI targets, color-coded by performance vs. target
- Anomalies — any metrics outside normal range with a causal explanation (e.g., “Search Campaign #3 CPA spiked 40% — driven by 3 keywords with zero conversions in 30 days and $800 combined spend”)
- Strategy drift — any campaigns running in violation of your STRATEGY.md directives
- Wasted spend candidates — specific line items with dollar amounts and recommended action
- Top 3 actions — prioritized by estimated impact with the data reasoning for each
No dashboard tabs. No CSV exports. No spreadsheet building. From terminal prompt to structured analysis in a few minutes.
What Autonomous Mode Actually Means
“Autonomous” in Claude Code means something specific — and something more limited than the word might imply. It’s worth being direct about this.
What Claude Code Can Run Unsupervised
These are read-only operations. Claude Code can be scheduled to run these on a cron schedule without your presence:
- Pull performance data and generate reports
- Flag anomalies against your KPI targets
- Identify wasted spend candidates
- Check for strategy drift
- Generate copy drafts
- Research keywords and audience segments
What Always Requires Your Approval
These are write operations that affect live campaigns and real spend. Claude Code will stop and wait for you before executing any of these, regardless of your settings:
- Enabling any campaign from PAUSED to LIVE
- Changing any budget (daily or monthly)
- Modifying targeting on a live ad set
- Adding or removing keywords
- Changing bidding strategies
The model where an AI “runs your ads without you” is the wrong frame. The right frame: the agent handles the analysis, research, and drafting — the parts that consume 80% of the time but require 20% of the judgment. You make every call that involves live spend. This is the boundary that makes autonomous ad management practical rather than reckless.
Setting Up Scheduled Audits
To schedule a weekly performance check using Claude Code’s scheduling system:
claude schedule create \ --name "Weekly Google and Meta Audit" \ --cron "0 8 * * MON" \ --prompt "Run a performance review across Google Ads and Meta Ads for the last 7 days. Compare against KPI targets in CLAUDE.md. Flag any CPA increases above 25%, any Meta creatives with frequency above 3.0, and any keywords spending over $100 without a conversion. Return a prioritized action list I can review first thing Monday morning." \ --working-dir ~/Clients/YourBrandThis creates an agent that fires every Monday at 8 AM, reads your brand context, pulls fresh data from both platforms, and sends you a structured report — without you opening any ad interface.
Google Ads vs Meta Ads from Claude Code
Both platforms connect through the same Adspirer MCP server, but the workflows and what the agent monitors differ by platform.
PromptBoxes: 5 Commands to Run This Week
Beyond the audit commands above, these are the five prompts that deliver the most value in the first week of using Claude Code with Adspirer:
FAQ
What’s Next
Your setup is complete: the Adspirer plugin is installed, Google Ads and Meta Ads are connected, your brand workspace is created, safety rules are configured, and your first performance audit is done.
The two highest-value next steps from here:
- Set up the weekly scheduled audit — the Monday morning prompt above. Once this runs automatically, you stop missing the Friday CPA spike that compounds over the weekend.
- Build out your STRATEGY.md — after each audit session where the agent identifies a pattern (e.g., “broad match on branded terms is cannibalizing conversions”), add a confirmed CONSTRAINT directive. Over time, this file becomes the accumulated knowledge of every insight you’ve validated.
The compounding effect is real: the more sessions you run, the more context the agent carries into the next one. Three months in, Claude Code is not starting fresh every Monday — it’s working from a complete picture of your account history, your brand constraints, and your proven strategies.
Ready to start? Sign up for Adspirer (free tier: 15 tool calls/month) and install the plugin with /plugin install adspirer-ads-agent.
Related Articles
- How to Set Up Your AI Marketing Agent with Claude Code — Full agent architecture: sub-agents, MEMORY.md, web research capabilities
- How to Set Up Your AI Marketing Agent with Codex — The OpenAI Codex equivalent for scheduled autonomous workflows
- How to Build an AI Marketing Agent for Paid Media — The concept and architectural decisions behind agentic ad management
- What Is MCP (Model Context Protocol)? — The protocol that makes Claude Code + Adspirer possible
More articles to read
Best AI Ad Management Platform 2026: Complete Buyer's Guide
7 AI ad management platforms compared honestly — including the new category of MCP-based tools that work inside Claude and ChatGPT. Who should use what, real pricing, and the trade-offs nobody else explains.
Should You Hire a PPC Specialist or Use AI? 2026 Guide
Honest comparison of hiring a PPC manager vs using AI tools like Claude and ChatGPT to run Google Ads and Meta campaigns in-house. Includes real cost breakdown.