Meta Pixel

Connect Codex to Meta Ads with LoomaScale

Connect OpenAI Codex to Meta Ads by installing the LoomaScale plugin with two terminal commands and signing in once in your browser. Codex can then review Facebook and Instagram campaigns, ad sets and placements, and make the changes you ask for inside your spend cap. No Meta app, access token or config file is needed.

Updated

Connection overview

  1. Connect Meta Ads in LoomaScale and set a daily spend cap.
  2. In your terminal, run codex plugin marketplace add loomascale/agent-plugin.
  3. Run codex plugin add loomascale@loomascale.
  4. Run codex mcp login loomascale and sign in to LoomaScale in your browser.
  5. Start Codex, check the account with a read-only prompt, then run a wasted-spend review.

What you need before you start

  • The Codex CLI with plugin support. If codex plugin is not recognized, update Codex first.
  • A LoomaScale account with Meta Ads connected and a daily spend cap configured.
  • Access to the Meta ad account. Creating ads also requires access to the relevant Facebook Page and any Instagram identity you use.

First, connect your Meta ad account in LoomaScale

Open Connections in LoomaScale, connect Meta Ads, and authorize your Meta login. Select the correct default ad account and set its daily spend cap. Note the ad account ID. Facebook and Instagram ads both run through Meta ad accounts.

Open LoomaScale connections

Connect Codex, step by step

  1. Add the LoomaScale plugin marketplace

    In your terminal, run the command below. It registers LoomaScale’s public plugin repository on GitHub as a Codex marketplace, so Codex can find the plugin. Nothing is installed yet.

    codex plugin marketplace add loomascale/agent-plugin

  2. Install the plugin

    Run the install command. Codex adds the LoomaScale MCP server and its skills for waste audits, performance reviews, budget pacing, campaign launches, conversion tracking audits and scheduled checks. Start a new Codex session afterwards so it loads them.

    codex plugin add loomascale@loomascale

  3. Sign in to LoomaScale

    Run the login command. Your browser opens LoomaScale’s consent screen: sign in with the account that holds your Meta Ads connection and choose Allow. The screen names localhost as the destination because Codex receives the sign-in on your own computer. The terminal confirms when you are logged in. You never paste a password or access token into Codex.

    codex mcp login loomascale

  4. Check your Meta ad account

    Start Codex and send the read-only test prompt below. Codex calls LoomaScale and returns your ad account ID, currency and campaigns. With more than one ad account, name the one you mean in each request.

    Use LoomaScale to show my default Meta ad account name, account ID and currency, then list its campaigns and statuses. Read only: do not create or change anything.

  5. Run a wasted-spend review

    Ask for a wasted-spend review. Codex reads spend and results by campaign, ad, placement and age through LoomaScale, and ranks findings by money lost. It changes nothing unless you ask. Check which event each ad set optimizes for: a cheap result is only useful if it leads to revenue.

    Analyze my active Meta Ads campaigns for wasted spend

    OpenAI Codex reviewing Meta Ads through LoomaScale: Instagram Reels spent $49.78 with zero leads while Instagram Feed cost $8.90 per lead
    A real Meta Ads wasted-spend review in Codex through LoomaScale. Results depend on your account and data.
Codex plugin documentation

Add the MCP server without the plugin

Prefer to manage MCP servers yourself? Run this command instead of steps 1 and 2, then sign in with codex mcp login loomascale as in step 3. You get the LoomaScale tools without the plugin’s skills.

codex mcp add loomascale --url https://api.loomascale.com/mcp

What Codex can do with your connected account

Review campaigns and ad sets

Compare spend, results and cost per result. Group comparable objectives: results from different campaign objectives are not interchangeable.

Investigate creative fatigue

Compare creatives using frequency, click-through rate and cost per result. Separate observed performance changes from possible explanations.

Compare Facebook and Instagram placements

Use available placement breakdowns to compare delivery and results. Flag limited data before recommending changes.

Prepare requested campaign changes

With write and asset permissions, request campaign drafts, ad sets or budget changes. New campaigns start paused; spending changes must fit your daily cap.

Three read-only prompts to try next

Find ad sets needing attention

Review my default Meta ad account for the last 30 days. Show spend, results and cost per result by ad set. Group comparable objectives and identify three issues to investigate. Make no changes.

Check for creative fatigue

Compare the last 7 complete days with the previous 7 for my Meta ads. Find rising frequency alongside falling click-through rate or increasing cost per result. Suggest creative tests without changing ads.

Compare placement performance

Compare Facebook and Instagram placements for the last 30 days using available breakdowns. Show spend, results and cost per result, flag limited data, and suggest tests. Do not change targeting or budgets.

If the connection does not work

codex plugin is not recognized.

Update the Codex CLI to the latest version and run the marketplace command again. Plugin commands need a recent Codex release.

The marketplace or install command fails.

Check the exact names: the marketplace is loomascale/agent-plugin and the plugin is loomascale@loomascale. Make sure your network can reach github.com.

Codex says loomascale is not logged in.

Run codex mcp login loomascale again and finish the sign-in in your browser. Check the status with codex mcp list, then start a new Codex session.

Authorization finishes but Meta Ads is missing.

Confirm Meta Ads is connected in LoomaScale under the login used in Codex. If you authorized another LoomaScale account, reconnect with the correct login.

I see the wrong ad account or an access error.

Compare the ad account ID. Select the correct default or specify the ID. If Meta permissions were removed, restore access and reconnect Meta Ads.

Campaign reporting works but creating ads fails.

Check write permissions and Facebook Page or Instagram identity access. Reporting access is insufficient for creating ads. Review errors for missing assets or spending above your daily cap.

Frequently asked questions

How does Codex connect to Meta Ads?

The LoomaScale plugin adds LoomaScale’s remote MCP server to Codex. After you sign in with OAuth, Codex calls its tools to read your connected Meta Ads accounts or make supported changes, within the permissions and daily spend cap you set in LoomaScale.

How is this different from the ChatGPT app?

The LoomaScale app works inside ChatGPT on the web and in the ChatGPT apps. The Codex plugin works in your terminal and adds skills for audits, pacing and launches. Both use the same LoomaScale account and ad connections.

Does it cover Instagram ads?

Yes. Instagram ads run through Meta ad accounts, so Codex reads them with your Facebook campaigns and can compare placements across both.

Do I need a Meta app or access token?

No. LoomaScale hosts the connection and uses your Meta authorization. There is no Meta developer app, token or config file.

Is connecting Codex to Meta Ads free?

LoomaScale offers a 14-day free trial without a card. Codex needs its own ChatGPT plan or OpenAI API billing. Meta bills your advertising spend separately.

Can Codex change campaigns or budgets?

Yes, when you ask. Codex asks for approval before each change, then LoomaScale checks it against your daily spend cap. New campaigns start paused. Use read-only prompts for analysis.

Related guides

Start with your own campaign data

Connect your ad account, install the LoomaScale plugin in Codex, and run a waste audit. Try LoomaScale free for 14 days; no card required.

Connect an ad account

Connect your assistant to your ad platform

LoomaScale runs inside the assistant you already use. Pick the pair you work with; each guide takes about five minutes.

ChatGPT
Google Ads

Manage Google Ads campaigns from ChatGPT: search terms, budgets and new campaigns, paused for your review. One-click install from ChatGPT's directory.

Read the integration
Claude
Google Ads

Manage Google Ads from Claude: audits, budget changes and new campaigns, every write inside the spend cap you set. Connect from Claude's directory.

Read the integration
Claude Code
Google Ads

Install the LoomaScale plugin in Claude Code with two commands and audit Google Ads from your terminal: search terms, budgets and pacing, with skills built in.

Read the integration
Codex
Google Ads

Install the LoomaScale plugin in OpenAI Codex with two commands and audit Google Ads from your terminal: search terms, budgets and conversion goals.

Read the integration
ChatGPT
Meta Ads

Manage Facebook and Instagram campaigns from ChatGPT: ad sets, budgets and creatives in one chat. The same one-click install.

Read the integration
Claude
Meta Ads

Manage Facebook and Instagram campaigns from Claude: audits, budget caps and new ad sets, inside the limits you set.

Read the integration
Claude Code
Meta Ads

Run Facebook and Instagram campaign reviews from Claude Code: the same plugin, one sign-in, and skills for waste audits, pacing and creative fatigue.

Read the integration
Manus
Google Ads

Connect Manus to Google Ads through LoomaScale’s MCP server. Analyze campaigns, keywords and search terms, then request changes within your permissions and spend cap.

Read the integration
Slack
Google Ads

Ask Slackbot about Google Ads in any Slack DM: audits, search terms and pacing checks, with changes kept inside your spend cap. Install the app once per workspace.

Read the integration
Manus
Meta Ads

Connect Manus to Meta Ads through LoomaScale’s MCP server. Review Facebook and Instagram campaigns, ad sets, creatives and placements.

Read the integration
Slack
Meta Ads

Ask Slackbot about Facebook and Instagram campaigns in any Slack DM: delivery, pacing and ad-set spend, read live from Meta Ads.

Read the integration