AI advertising operations

The AI agent ad stack: running ads with Claude, ChatGPT and other agents

AI assistants now reach ad accounts through MCP (Model Context Protocol) servers. Meta, Google and Amazon publish official ones, and many community servers exist. Start read-only with a separate login, set a spend cap in the ad platform itself, and compare the agent's numbers with your own for a week. Then let it draft changes that you approve one at a time. Keep billing, user access and deletes out of the agent's reach entirely, and log every tool call.

In 2026 you can ask an AI assistant "which ads wasted money last week?" and get an answer pulled live from your ad account. The same connection can also let it create campaigns, change budgets and switch ads on. That second part is where small mistakes turn into real spend.

This guide shows the whole stack: what connects an assistant such as Claude or ChatGPT to Meta Ads, Google Ads, Google Analytics 4 (GA4) and Shopify; which official and community tools exist today (each one checked on GitHub on 16 November 2026); how to set it up read-only on day one; how to let it draft changes for your approval in week two; and the guardrails that stop an agent from spending money you didn't agree to. It is written to work with any model. A short box near the end explains what to re-check when a new model comes out.

The workbook has two tools. The permissions planner lists 30 common agent actions across Meta, Google Ads, GA4 and Shopify and lets you mark each one Allowed, Needs approval or Forbidden, with spend caps that calculate your daily and weekly limits and a review log. The prompt library holds 24 prompt patterns with their purpose, the data each one needs and its risk level.

The short version

If you read nothing else, do these six things in order:

  • Give the agent its own login or token with read-only access. Never reuse your admin login.
  • Set a spend limit inside the ad platform (for example, Meta's account spending limit). The agent can't talk its way past a limit it can't edit.
  • For one week, ask only reporting questions, and check five answers by hand against Ads Manager.
  • Then let it draft changes. Every change becomes a request you approve, edit or reject, one change at a time.
  • Log every tool call: who asked, what changed, the old and new value, and when.
  • Keep billing, payment methods, user access and deletes out of the agent's tool list completely.

How the pieces fit together

A few terms first, in plain words:

  • API (application programming interface): the official door a program uses to read or change your ad account. Meta's is the Marketing API; Google's is the Google Ads API.
  • SDK (software development kit): a code library that makes an API easier to use from Python, Node.js or another language.
  • MCP (Model Context Protocol): an open standard that lets an AI app call outside tools in a consistent way. An MCP server wraps an API and offers a list of named tools, such as "get campaign insights" or "create ad set". An MCP client is the AI app that calls them: Claude, ChatGPT, Gemini, Cursor, Claude Code, Codex and many others.
  • OAuth: the "Log in with Facebook / Google" style sign-in that grants an app limited access without sharing your password.

Diagram: you ask the AI assistant; it reads data through an MCP server from the ad platform API. Any proposed change goes down to an approval gate that shows account, object, old and new value, spend impact, reason and undo. Only an approved write goes to the API. Below sit a change log, hard limits set in the platform, and a red box listing what never goes through the agent: billing, payment methods, user access and deletes. The pattern this guide recommends: reads flow straight through, writes stop at a person.

The important idea is the split. Reading data is low risk: the worst case is a wrong answer, which you can check. Writing (creating, editing, activating, deleting) changes what you spend and what your customers see. The MCP specification itself says there "SHOULD always be a human in the loop with the ability to deny tool invocations" (MCP tools specification). Everything else in this guide follows from that.

What exists today: connectors, SDKs and repos

Every GitHub repository below was checked with the GitHub command-line tool on 16 November 2026. Star counts and last-update dates are from that day and will change. Stars measure popularity, not safety. A server you connect will see your ad data and, for some, hold a token that can spend money. Prefer official servers, read the code of community ones, and check who maintains them.

Connectors (MCP servers) for ad accounts and data

ConnectorWho makes itWhat it can doWho should use it
Meta Ads MCP server (mcp.facebook.com/ads)Meta, hosted28 tools: reporting, Ad Library search, audiences, and creating campaigns, ad sets and ads. Meta's docs say write tools create objects paused, and a separate ads_activate_entity tool "starts spending budget".Anyone on Meta. Start here before any third-party option.
googleads/google-ads-mcp (1,183 stars, updated Nov 2026)Google, open sourceRead with GAQL (Google Ads Query Language). Small set of writes (assets, labels) behind a "propose and confirm" step with a checksum, plus a built-in audit log. Write tools can be switched off in tools_config.yaml.Google Ads advertisers who want an official, read-first server.
googleanalytics/google-analytics-mcp (3,800 stars)Google, open sourceGA4 reports, funnels, realtime and conversions reports. Write tools only appear with an --allow-write flag.Anyone who wants the agent to check site behaviour and conversions, not just ad clicks.
Amazon Ads MCP serverAmazon, open beta since 2 Feb 2026Campaign creation, updates and deletes, reporting, account settings, and access to billing and financial data. Available to Amazon Ads API partners with active credentials.Amazon sellers with API access. Lock it down: it can reach billing.
Shopify/Shopify-AI-Toolkit (649 stars) and the Dev MCP (@shopify/dev-mcp)ShopifyShopify documentation, API schemas and code validation; store management through the Shopify CLI. The Dev MCP itself runs locally without store authentication.Teams building on Shopify. For store data such as orders, see the community row below.
pipeboard-co/meta-ads-mcp (1,375 stars)Pipeboard, open source plus hosted serviceMeta Ads read and write; sister servers for Google, TikTok, Snap and Reddit. Says writes ask for confirmation and new campaigns start paused.People who want one connector across several ad platforms and accept a third party in the middle.
cohnen/mcp-google-ads (724 stars, last push Oct 2025)CommunityGoogle Ads analysis through GAQL.A simple read-only learning project. Less active than Google's official server.
GeLi2001/shopify-mcp (239 stars)CommunityShopify Admin API: products, customers, orders, inventory. Includes order cancel and refund tools.Store owners who want order and product data. Give its app read scopes only.
AdsMCP/tiktok-ads-mcp-server (54 stars)CommunityTikTok Ads Marketing API. We found no official TikTok MCP server.TikTok advertisers comfortable reviewing a small project's code.

SDKs and agent builder kits

RepoWhat it is forWho should use it
meta/facebook-python-business-sdk (1,624 stars) and meta/facebook-nodejs-business-sdk (626 stars)Meta's official Marketing API librariesDevelopers writing their own Meta tools
googleads/google-ads-python (763 stars) and googleads/google-ads-java (211 stars)Google's official Google Ads API librariesDevelopers writing their own Google Ads tools
tiktok/tiktok-business-api-sdk (237 stars)TikTok's official Business API SDKDevelopers on TikTok
modelcontextprotocol/python-sdk (24,874 stars) and typescript-sdk (13,774 stars)Official kits for building your own MCP serverAnyone wrapping an API as a small, safe tool list
modelcontextprotocol/inspector (11,308 stars)Test an MCP server and see exactly which tools it exposesEveryone, before connecting a server to a live account
modelcontextprotocol/registry (7,470 stars) and modelcontextprotocol/servers (92,050 stars)The community registry of MCP servers, and the reference serversFinding servers and learning how good ones are built
anthropics/claude-agent-sdk-python (8,563 stars) and claude-agent-sdk-typescript (1,886 stars)Build your own agent on the same loop as Claude Code, with permission controlsDevelopers building an internal ads agent
openai/openai-agents-python (30,719 stars) and openai-agents-js (4,021 stars)OpenAI's agent framework, with MCP supportDevelopers on OpenAI models
google/adk-python (22,242 stars) and langchain-ai/langgraph (45,032 stars)Google's Agent Development Kit, and a graph-based agent frameworkDevelopers who want to choose any model

Skills, plugins and hooks

RepoWhat it is forWho should use it
anthropics/skills (195,987 stars)Anthropic's public Agent Skills. skill-creator helps you write your own; mcp-builder guides building an MCP server.Anyone turning a repeated ads task into a reusable skill
coreyhaines31/marketingskills (60,793 stars)Marketing skills for Claude Code and other agents, including ads and ad-creative. The ads skill tells the agent to label unavailable inputs "MISSING" rather than estimate.Marketers who want a good starting playbook for the agent
anthropics/claude-plugins-official (47,465 stars)Anthropic's directory of Claude Code plugins. Shopify's AI Toolkit installs from it.Claude Code users
anthropics/claude-code (155,912 stars) and openai/codex (135,530 stars)Terminal agents that connect to MCP servers. Claude Code adds permission rules and hooks you can use as guardrails.People comfortable in a terminal who want the strongest controls

Pick your setup

No codeTerminal agentBuild your own
What you useClaude or ChatGPT apps with a custom connectorClaude Code or Codex with MCP serversAn agent SDK plus the official ad SDKs
Set-up timeMinutesAn hourDays
Approval controlsThe app's own confirmation promptsAllow, ask and deny rules, plus hooks that can block a callWhatever you build: your own approval queue
Best forOwners who want answers, not codeMarketers and technical foundersTeams with a developer and a clear workflow

For the no-code route, Claude supports custom connectors using remote MCP. ChatGPT supports custom MCP servers in developer mode; OpenAI's page labels it "Elevated risk", says write actions need confirmation by default, and treats any tool without a readOnlyHint annotation as a write action.

Day 1: read-only reporting

The goal today is narrow: the agent can see everything and change nothing.

1. Give the agent its own, limited access.

PlatformWhat to grantWhere it's documented
Google AdsA separate user with Read only access. Google's help says Read only users can view campaigns and run reports but can't edit campaigns or billing.Google Ads access levels
Meta AdsFor Meta's MCP server, the minimum permissions are ads_mcp_management plus ads_read or ads_management. Choose ads_read. Meta notes that Admin-role system user tokens can't use the server; only Employee-role ones work.Meta MCP: get started
GA4The official server needs only the analytics.readonly scope. Leave off the --allow-write flag.GA4 MCP README
ShopifyA custom app with read_ scopes only (for example read_orders, read_products).Your Shopify admin, Apps settings

2. Set a spend limit in the platform, by hand. On Meta, the ad account's spending limit (spend_cap in the API) means "when the amount is reached, all delivery stops" (Meta Ad Account reference). Set it yourself in billing settings, outside the agent's reach. It's the last line of defence if everything else fails.

3. Connect. These are the documented commands for Claude Code. Other clients use the same server URLs.

# Meta's official server (replace with your Meta app ID)
claude mcp add --transport http --client-id YOUR_META_APP_ID meta-ads https://mcp.facebook.com/ads

# Google Analytics 4, read-only (credentials set up as in the README)
claude mcp add analytics-mcp --scope user \
  -e "GOOGLE_APPLICATION_CREDENTIALS=PATH_TO_CREDENTIALS_JSON" \
  -e "GOOGLE_CLOUD_PROJECT=YOUR_PROJECT_ID" \
  -- pipx run analytics-mcp

# Shopify developer docs and schemas (no store access)
claude mcp add --transport stdio shopify-dev-mcp -- npx -y @shopify/dev-mcp@latest

For Google's Ads server, turn the write tools off before you connect it. Put this in a tools_config.yaml (the README calls this a "strictly read-only" setup):

namespaces:
  labels: false
  assets: false

4. Block writes in the client too. Belt and braces: even with read-only access, tell the client to deny write tools. Claude Code evaluates rules in the order deny, then ask, then allow, and a deny always wins. MCP tools are named mcp__server__tool. This project .claude/settings.json lets the agent read Meta data freely and denies the tools that spend or touch personal data:

{
  "permissions": {
    "allow": [
      "mcp__meta-ads__ads_get_ad_accounts",
      "mcp__meta-ads__ads_get_ad_entities",
      "mcp__meta-ads__ads_get_creatives",
      "mcp__meta-ads__ads_library_search"
    ],
    "deny": [
      "mcp__meta-ads__ads_activate_entity",
      "mcp__meta-ads__ads_delete_custom_audience",
      "mcp__meta-ads__ads_update_custom_audience_users"
    ]
  }
}

Use an allow list for reads, not a list of what's forbidden. Servers add tools over time. A new tool that isn't on your allow list will prompt you instead of running silently.

5. Ask, then check. Use the analysis prompts below. Pick five answers and check them by hand in Ads Manager or Google Ads: same date range, same attribution setting, same currency. If two of five disagree, fix the prompt (usually the date range or attribution window) before going further.

Week 2: let it draft changes for your approval

Once its numbers match yours, let the agent propose changes. It still can't make them.

  • On Meta, allow the create tools. Meta's docs say they create campaigns, ad sets and ads paused, and "your AI client asks for confirmation before activation." Keep ads_activate_entity denied: you switch ads on yourself in Ads Manager after checking the preview.
  • On Google Ads, the official server's write tools already use a two-step "propose and confirm" flow. The first call is a dry run that returns the change and a checksum. The second call only works with that exact checksum, after you approve.
  • On OpenAI's API, remote MCP tools ask for approval by default. The require_approval setting can switch that off for named tools; leave it on for anything that writes (OpenAI: MCP servers).

Example approval card for a fictional store: account, object, change from an $80 to a $96 daily budget (+20%), spend impact +$16 a day or about +$112 over seven days, the reason with a seven-day date range, a rule check against the +20% cap and how to undo it, with Approve, Edit and Reject buttons. Five callouts: one change per card, old and new value, money per day and per week, the evidence with its date range, and how to undo. If the agent can't fill every line of this card, it isn't ready to ask you.

Add a hook that logs and blocks

In Claude Code, a hook is a small script that runs before or after each tool call. A PreToolUse hook that exits with code 2 blocks the call, and a matching permission deny rule still applies whatever the hook says (Claude Code hooks). This one writes every ad tool call to a log file and blocks anything that activates, deletes or touches billing or users:

#!/usr/bin/env bash
# ~/.claude/hooks/ads-guard.sh  (needs jq installed)
input=$(cat)
tool=$(echo "$input" | jq -r '.tool_name')
echo "$(date -u +%Y-%m-%dT%H:%M:%SZ) $input" >> "$HOME/.claude/ads-agent-log.jsonl"
case "$tool" in
  *activate*|*delete*|*billing*|*payment*|*_users*|*spend_cap*)
    echo "Blocked: $tool must be done by a person in the ad platform." >&2
    exit 2 ;;
esac
exit 0
{
  "hooks": {
    "PreToolUse": [
      { "matcher": "mcp__.*", "hooks": [ { "type": "command", "command": "~/.claude/hooks/ads-guard.sh" } ] }
    ]
  }
}

The log file is your change log's raw material. Once a week, copy the write calls into the workbook's Review log tab.

Weeks 3 and 4: small, capped changes (optional)

Some teams let the agent make a few pre-agreed changes without asking each time, inside caps. If you do, write the rules down in numbers. An example for a fictional store spending $3,000 a month:

RuleExample valueWhy
Monthly spend cap set in Meta billing$3,000The platform stops delivery here, whatever the agent does
Largest daily budget change, per ad set+/-20%Small steps are easy to undo and to read
Largest total daily increase across the account$50Caps the damage from several "small" changes at once
Actions allowed without askingPause an ad that spent 2x target cost per purchase with zero purchasesReduces spend; easy to reverse
Actions that always need a personActivating anything, new audiences, new claims, any increase above the capsThese start or raise spend, or change what customers see

The workbook's Spend caps tab turns your monthly cap into a daily allowance and flags any proposed change that breaks a rule.

Timeline: Day 1 read-only with a read role; days 2 to 7 compare five answers by hand; week 2 drafts for approval with objects created paused; weeks 3 to 4 capped writes such as budget changes of plus or minus 20%; every month, read the log and re-test prompts on each new model. Move right only when the stage before it has become boring.

The guardrails, and why "nothing spends without approval"

GaaS works on one rule: nothing spends without the owner's approval. It's the right default for a do-it-yourself setup too, for four reasons.

  1. Money spent can't be un-spent. A wrong report costs you a minute. A wrong budget increase costs you the money, and you only see it a day later.
  2. Agents misread context. Attribution windows, currencies, time zones and test campaigns all look like ordinary numbers. A person spots "that's the old campaign" in a second.
  3. Text can carry instructions. Ad comments, landing pages and competitor ads in the Ad Library are text written by strangers. An agent that reads them can be pushed by them; this is called prompt injection. OpenAI's MCP guidance warns that servers can carry hidden prompt injections, and that a malicious server "can exfiltrate sensitive data from anything that enters the model's context." An approval step means injected text can't spend money on its own.
  4. Approvals teach you the account. Reading a clear request every day is the fastest way for a busy owner to learn what's working.

Risk matrix with damage if wrong on one axis and how hard to undo on the other. Green, allowed: pulling reports, summarizing search terms, drafting copy in a document. Amber, needs approval: creating a paused campaign, uploading a new image asset, a negative keyword, pausing a top campaign, editing live ad text, changing targeting, shifting budget within caps, raising a budget, boosting an Instagram post. Red, forbidden: uploading a customer list, publishing an unchecked claim or AI image of a person, deleting campaigns or ads, changing billing or users, switching on spend or removing caps. Place each action by damage and by how hard it is to undo. The colour is the permission.

The rules in one list:

  • Read-only first. Separate login, read role, read scopes.
  • Caps live in the platform. Account spending limit set by a person. The agent's own rules are a second layer, not the first.
  • One change per approval, showing old value, new value, money per day and per week, evidence with dates, and how to undo it.
  • Log everything: every tool call, not just writes. Google's official Ads server already writes a structured audit record for each call.
  • Never through the agent: billing, payment methods, adding or removing users, deleting campaigns or ads, removing spend caps. Pause instead of delete; a person deletes.
  • Trust the server, not the stars. Prefer official servers. For a community server, read the code, pin a version and test it with the MCP Inspector before it sees a live token.
  • Revoke in one click. Know where to remove the agent's access (the user in Google Ads, the app or token in Meta Business settings) before you need to.

The permissions matrix guide goes deeper on assigning each action, and the budget guardrails guide on choosing cap values.

Prompts that work

Analysis prompts and change prompts need different shapes. An analysis prompt should pin down scope and ask the agent to show its working. A change prompt should ask it to propose, not do.

UseA prompt pattern that worksWhy
AnalysisName the account, date range, attribution setting and currencyMost wrong answers come from the wrong scope
Analysis"Show the raw numbers and the query you ran"You can check them in a minute
Analysis"If a number is unavailable, write MISSING. Don't estimate."Stops confident guesses
Change"Propose up to 3 changes. Don't make any."Keeps writes behind your approval
Change"For each: old value, new value, spend impact per day and week, evidence with dates, how to undo"Fills the approval card
Change"Check each change against these caps: ..."The agent flags its own rule breaks

Four to copy:

ANALYSIS: weekly check
Account: [account name / ID]. Date range: last 7 full days vs the 7 days before.
Attribution: 7-day click, 1-day view. Currency: USD.
Show spend, purchases, cost per purchase and ROAS (revenue / spend) by campaign.
List the 3 biggest changes and the likely cause of each, labelled as a guess.
Show the raw numbers and the query or tool call you used.
If any number is unavailable, write MISSING. Do not estimate. Do not change anything.
ANALYSIS: wasted spend
For the last 14 full days, list ad sets or keywords that spent more than [2x target cost per purchase]
with zero purchases. Include spend, impressions, clicks and the date range.
Sort by spend. Read only: do not pause or edit anything.
CHANGES: draft for approval
Based on the weekly check, propose up to 3 changes. Do not make any change.
For each one give: the object (name and ID), the current value, the new value,
the spend impact per day and per 7 days, the evidence with its date range,
whether it breaks any of these caps [paste caps], and exactly how to undo it.
Never propose deleting anything or touching billing, payment methods or users.
CHANGES: new campaign draft
Draft a new campaign for [product] using [audience] and [budget per day].
Create it PAUSED if your tools allow drafts; otherwise write it out as a plan.
List every setting you chose and why. I will review the preview and activate it myself.

The workbook's Prompt library tab has 24 of these, each with the data it needs and a risk level.

How to update this when a new model launches

  1. Re-run your ten saved test prompts and compare the answers with the known correct numbers in the workbook. Note any that changed.
  2. Check tool use: did the new model call any write tool during an analysis prompt? If so, keep it on read-only until you know why.
  3. Re-list each server's tools (the MCP Inspector or the client's tool list). Servers add tools; your allow list should catch them.
  4. Keep caps and approvals unchanged for two weeks, whatever the launch claims.
  5. Update the "last checked" date in your planner, and refresh this page's star counts and tool lists.

What's in the workbook

  • Start here: how to use it, in five steps.
  • Permissions planner: 30 actions across Meta, Google, GA4 and Shopify. Each one has a risk score from damage and undo difficulty. Choose Allowed, Needs approval or Forbidden; the sheet counts your choices and flags any action you allowed that scores 4 or more out of 6.
  • Spend caps: enter a monthly cap and change limits; it calculates the daily allowance and checks a list of proposed changes against your rules.
  • Review log: one row per agent change, with old and new values and a formula for the change in percent.
  • Prompt library: 24 prompts with purpose, data needed, risk level and the expected output.

The CSV version on the template page has the permissions list for any spreadsheet tool.

Or let GaaS run it

If you'd rather not wire this up yourself, GaaS is built on the same rule. You give it your website, a spend limit and a one-line goal; it makes, launches and improves Meta and Google ads, and every change that spends money waits for your approval in plain words. Either way, the guardrails above are worth keeping.

Set budget guardrails for an AI media buyer

Define spending authority for an AI media buyer with account scope, remaining-budget calculations, cumulative-change limits, and a reviewable approval example.

An advertising agent change log you can actually audit

Build a change log that separates AI recommendations, approvals, attempted actions, confirmed platform changes, and later campaign outcomes.

Build an AI ad agent permissions matrix

Define exactly what an AI media buyer may read, recommend, prepare, and execute, with an example permissions matrix and approval ownership.

The three layers of an autonomous advertising stack

Evaluate an AI advertising architecture through observation, decision, and execution layers, with clear data contracts, permissions, and failure handling.

Have a correction or a question about the workflow? Contact GaaS. Read our editorial standards for sourcing and example conventions.