# 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.

```text
$ 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
```

## Set up in 3 steps.

1. Create your LinkedIn developer app. Add the Advertising API product. It's free, and approval usually takes a day or 2.

   [linkedin.com/developers/apps](https://www.linkedin.com/developers/apps)
2. Sign in from your terminal. Adwarp opens your browser for LinkedIn's approval and stores the token locally.

   `npx -y adwarp auth login`
3. Add it to Codex. 1 command, and Codex can use all 28 LinkedIn tools.

   `codex mcp add adwarp -- npx -y adwarp mcp`

## 5 prompts to try first.

### Build an audience from our closed-lost deals in Salesforce.

```text
$ 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.
```

### Set up account-based ads for each company in accounts.csv.

```text
$ 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
```

### Is a RevOps audience in Canada big enough to run?

```text
$ codex
> Is a RevOps audience in Canada big enough to run?
adwarp.estimate_audience RevOps, VP + Director, Canada: 240 members
Under LinkedIn's 300 minimum, so it wouldn't serve.
Adding Manager seniority brings it to 610. Want that instead?
```

### Turn on the VP Demand Gen ad group.

```text
$ codex
> Turn on the VP Demand Gen ad group.
adwarp.update_campaign status ACTIVE, dry run: preview
adwarp.update_campaign status ACTIVE: ACTIVE
Live because you asked. Everything else stays a draft.
```

### What ads is our biggest competitor running?

```text
$ codex
> What ads is our biggest competitor running?
adwarp.inspect_competitor_ads name search: 394 ads
61% single image, 22% document, 17% video
```

## 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.

## Questions, answered.

### 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 |

## Related

- [Salesforce audiences](https://adwarp.dev/integrations/salesforce): Build an audience from a query
- [Account-based ads](https://adwarp.dev/linkedin-ads/abm): 1 audience per target account
- [LinkedIn Ads CLI](https://adwarp.dev/linkedin-ads/cli): Script it instead

Unofficial. Not affiliated with or endorsed by LinkedIn or Google.

Canonical page: https://adwarp.dev/linkedin-ads/codex
Last updated: 2026-10-18
