LinkedIn Ads in Codex.
Adwarp is an open-source MCP server and CLI that connects the Codex CLI to LinkedIn Ads. Add it with 1 command from your terminal, then ask Codex to size audiences, draft campaigns and pull reports.
$ codex mcp add adwarp -- npx -y adwarp mcp$ codex
> Set up account-based ads for each company in accounts.csv.
adwarp.search_targeting companies from accounts.csv: company URNs
adwarp.estimate_audience decision makers per account: 400 to 1,000
adwarp.create_campaign 1 per account, 2-week flight: DRAFT
adwarp.create_image_ad 3 per account: DRAFT
01Set up
Set up in 3 steps.
Create your LinkedIn developer app
Add the Advertising API product. It's free, and approval usually takes a day or 2.
Sign in from your terminal
Adwarp opens your browser for LinkedIn's approval and stores the token locally.
npx -y adwarp auth loginAdd it to Codex
1 command, and Codex can use all 28 LinkedIn tools.
codex mcp add adwarp -- npx -y adwarp mcp
02Try these prompts
5 prompts to try first.
$ codex
> Build an audience from our closed-lost deals in Salesforce.
adwarp.audience_from_salesforce Closed Lost contacts: 1,204 contacts
Emails hashed with SHA-256 before upload
Matching now. Ready to target in up to 48 hours.
03Results
Why running ads from Codex gets better results.
Checks happen daily
Performance is 1 question in the terminal you already have open, so problems get fixed the same day.
Lists go straight in
Codex reads the CSV or Salesforce query in your working folder and turns it into a matched audience in the same session.
More variants tested
A new ad group is 1 ask instead of 20 clicks, so more audiences and messages get tried.
Does Adwarp work with OpenAI Codex?
Yes. Add it to the Codex CLI with codex mcp add, and Codex gets the same 28 LinkedIn tools as any other MCP client.
Is there an official LinkedIn Ads plugin for Codex?
No. LinkedIn doesn't offer one. Adwarp is independent and open source, and it uses LinkedIn's documented Marketing API through a developer app you create.
Can Codex spend money on its own?
No. Everything starts as a draft, and an ad group goes live only when you explicitly ask or switch it on in Campaign Manager.
Can I use it without Codex?
Yes. The same tools run as npx adwarp commands, for scripts and cron, with no AI client at all.
Where are my credentials stored?
In a local folder locked to your user. With the hosted endpoint they travel as headers, are used in memory and are never stored.
Does it run locally or on the hosted endpoint?
Either. Run Adwarp on your machine, or point Codex at the hosted endpoint with your own LinkedIn app credentials. List uploads, CRM audiences and the change journal need your machine.
| Feature | Local | Hosted |
|---|---|---|
| Campaigns, audience sizing, reporting | Yes | Yes |
| Ad Library through the official API | Yes | Yes |
| CSV list uploads | Yes | No |
| Salesforce audiences | Yes | No |
| HubSpot audiences | Yes | No |
| Change journal and lift | Yes | No |