Hey Prompt Warrior,
I built a system that handles the full Meta ads workflow: competitor research, writing scripts, generating images and videos, and publishing everything directly into my ads manager.
This post walks through each piece, how I built it, and how to set it up yourself.
If you prefer watching over reading, here's the YouTube video.
Here's what we'll cover:
The foundation you need before any AI can write ads that actually convert
Competitor research using Apify to scrape the Meta Ads Library automatically
Ad inspiration capture that transcribes and saves any ad you come across
Creative generation for image and video ads (2 methods)
Auto-publishing to Meta via Pipeboard MCP, no Ads Manager clicks required
Turning the whole thing into a weekly routine that optimizes itself
Read time: 7 minutes
📣 Quick plug
If you’re a service business owner, I'd love to help you deploy AI agents across your business.
What you get:
Margins that grow with every client instead of shrinking into payroll
Systems that keep running when people leave, built on agents instead of headcount
A real shot at being first in your industry before competitors catch up
Spots are limited. If that sounds like you, book a call here.
Now, back to the tutorial.
🧱 Start with Context
Before you touch any ad tool, you need two things in a folder your Claude Code can read.
First: a pains and dreams doc. I recorded myself talking through everything my prospects feel (the bad margins, the drowning workload, the fear of getting left behind), then had Claude enrich and format it. Raw and honest beats polished. The AI draws from this when writing copy.
Second: a business context folder. Landing pages, positioning docs, email swipe files, competitor screenshots. Everything that describes what you sell and how you talk about it. The more context you feed it, the more on-brand the output.
This step takes maybe 30 minutes. Everything after it depends on it.
🔍 Competitor Research + Ad Inspiration
Two ways to fill your creative intelligence bank.
Scraping the Meta Ads Library
Meta has a public ads library where you can search any brand and see what they're running. The ads running longest are usually a signal that they're performing.
The problem: Meta's API doesn't give you access to the library content. So instead I use Apify, which has a pre-built Meta Ads Library scraper. Much faster than having Claude drive a browser through it.
Best for: weekly competitor audits, spotting winning formats, finding angles before competitors scale them.
How to Set It Up:
Install the Apify CLI (see my CLIs video if you haven't)
Go to Apify, search "Meta Ads Library", pick the actor with the most reviews
In Claude Code, say: "Use the Apify CLI to run this actor on [competitor name]"
Claude runs the scrape and gives you a formatted HTML report of what they're running.
Real Example:
I asked it to research competitors in my niche. It pulled a full report of their active ads, sorted by run time. I had Claude note which formats kept showing up, and used those as creative direction for my own ads.
Pro tip: schedule this weekly. Set up a routine that runs the scrape every Monday and saves the output to a folder. You build a competitor signal library over time.
Saving ads you find while scrolling
When I see an ad on Instagram I like, I grab its link and tell Claude: "Get the transcript and save it to my Ads Inspiration folder."
Tokscript MCP handles this. But here's something worth knowing: sometimes a tool goes down. Tokscript dropped during my demo. Claude didn't stop. It switched to downloading the video directly and transcribing via the Whisper API.
That's the right way to build these systems: primary method first, backup method defined. Build in the fallback from the start.
Best for: capturing real-world ad examples in your voice and niche, as inspiration for your own scripts.
Once you have 5-10 inspiration scripts saved, ask Claude to rewrite each one for your offer using your pains/dreams doc. It does it in minutes.
🎨 Creative Generation
Two methods, depending on what kind of ad you want.
Method 1: Image ads via code templates
For text-on-image style ads (super common on Meta), Claude Code writes a reusable template that generates the ads for you. You paste a reference image or describe the style, say "make a template so we can generate more like this," and it builds it.
After that: "generate 5 image ads using my context docs and this template." It spits out finished image files into a folder on your computer ready to upload.
Best for: fast volume. 10 variations of a proven format in a few minutes.
Method 2: Higgsfield for richer images and video
For more polished visuals or video ads, I use Higgsfield, connected as both a CLI and MCP. From inside Claude Code, tell it to generate an image or video ad, describe the style, and reference any existing creative as a template.
The more specific you are, the better. Vague prompts give you stock-imagery energy. Tight prompts get you something actually usable.
For video: you can also just have Claude write the script, then read it and film it yourself. Simple, but it works, and the script quality is genuinely good when it's drawing from your context docs.
Pro tip: lock down your visual templates before generating at volume. Otherwise you get 20 different "vibes" and none of them feel like your brand.
🌐 Landing Page Variations (Optional but Powerful)
I built my entire site (joinagentos.com) in Claude Code. The code lives locally, so I can spin up new sub-pages fast.
When I want to test a new angle: "create a new sub-page at /content targeting the content niche." Claude builds it, I push it, and I track it via PostHog, which is also set up through Claude Code. Session replays, visitor counts, conversion by page, all inside dashboards the AI built for me.
Not everyone needs this piece. But if you're running ads and want to split test landing pages without a CRO agency, this is how to do it cheaply and fast.
🚀 Publishing to Meta via Pipeboard MCP
This is the piece that saves the most time.
Pipeboard is an MCP that connects directly to your Meta Ads account. Sign up (it's free), connect your ad account, then in Claude Code go to connectors and add the Pipeboard MCP. Done.
Now Claude has full access to your Meta account: campaigns, ad sets, creatives, audiences. It can create, update, duplicate, and publish, all without you touching Ads Manager.
Best for: removing the manual upload-and-click loop from the creative publishing step.
How to Set It Up:
Sign up at Pipeboard, connect your Meta ad account
In Claude Code, open Connectors and add the Pipeboard MCP
Ask Claude: "What tools do you have available and which ad account are you connected to?"
That last step confirms the connection is working.
Real Example:
Once my image ads are generated and saved locally, I say: "Upload these to my active ad set and publish." Claude handles the upload, creates the creatives in Meta, and publishes. The whole step that used to take 20-30 minutes of clicking through a clunky interface now takes one prompt.
What you can do with Pipeboard MCP:
Get current campaign performance
Create or duplicate campaigns and ad sets
Upload images and create ad creatives
Publish ads
Pull insights on what's working
⚙️ Wrap It Into a Weekly Routine
All of this can be run manually from Claude Code. But it gets much more useful once you turn it into a skill and put it on a schedule.
I created a skill called ad-variation-generator. Each run it:
Pulls the best-performing image ad from the current week
Diagnoses why it works (who it calls out, what pain it hits, what angle it uses)
Writes 5 fresh variations with different angles
Generates the image creatives
Duplicates the current ad set
Uploads and publishes via Pipeboard
Outputs a summary report
To automate it: I created a local scheduled task that runs the skill every Monday at 9am. One command.
The system compounds from there. Each week it finds what performed, generates variations, ships them, and starts the loop again.
🧭 The Decision Tree
Situation | Tool |
|---|---|
Scraping competitor ads | Apify CLI + Meta Ads Library actor |
Capturing ad inspiration from Instagram | Tokscript MCP (Whisper API as fallback) |
Text-on-image ads at volume | HTML/CSS code template in Claude Code |
Richer images or video ads | Higgsfield CLI/MCP |
Publishing to Meta without Ads Manager | Pipeboard MCP |
Running the whole flow weekly | Claude Code scheduled skill |
🎯 TLDR
✅ Feed your Claude Code a pains/dreams doc and business context folder before touching any ad tool
✅ Use Apify to scrape the Meta Ads Library and audit competitors automatically
✅ Tokscript saves ad inspiration from your scroll sessions; Whisper API handles the fallback
✅ Two creative methods: HTML/CSS image templates (fast volume) and Higgsfield (richer, visual)
✅ Pipeboard MCP connects Claude directly to Meta Ads, no Ads Manager required
✅ Wrap it in a skill and schedule it weekly: the system researches, creates, and publishes without you
Thanks for reading!
If you enjoyed this, consider forwarding this newsletter to a friend or colleague.
What would you like me to write about in the next post? Reply to this email and let me know.
P.S. Setting this up across a real business, connecting the context docs, wiring the tools, and building the automated routines, is exactly what I do inside AgentOS. If you want the system built for you instead of figuring out each piece yourself, take a look here.

