How to connect Codex to Meta Ads

Connect your Meta login once in Ryze AI, add one MCP URL to OpenAI Codex, then ask about Facebook and Instagram spend, ROAS, creatives and ad sets from the terminal or the app.

Your MCP URL
https://connector.get-ryze.ai/mcp

Copies the URL for codex mcp add, the desktop app or config.toml. See the steps

See pricing

By Ira Bodnar, Ryze AI · Updated

Quick answer

To connect Codex to Meta Ads, connect Meta Ads in a Ryze AI workspace with your Meta sign-in, then run codex mcp add ryze --url https://connector.get-ryze.ai/mcp, run codex mcp login ryze and allow the workspace. The same server also works from the Codex desktop app and IDE extension.

  1. In Ryze AI open Integrations, find Meta Ads under Advertising and click Connect
  2. Sign in to Meta and approve access with every requested permission checked
  3. Run codex mcp add ryze --url https://connector.get-ryze.ai/mcp
  4. Run codex mcp login ryze, click Allow connection, then run codex mcp list

Before you start

  • Codex access. Codex comes with ChatGPT Free, Go, Plus, Pro, Business, Edu and Enterprise. Free and Go users get the desktop app only, as the rollout allows. From Plus up the CLI and the IDE extension are included too. An OpenAI API key also works in the CLI, SDK or IDE extension and is billed at API rates. OpenAI lists no additional plan requirement for MCP servers.
  • A Meta login with access to an ad account. You need a Meta Business account with an ad account and at least Advertiser access on it, or Admin if Codex should be allowed to make changes. Access granted through Meta Business Manager is the best fit. Ryze AI sees every ad account that login can reach.
  • A Ryze AI workspace on a plan or free trial. Connecting is free, but the 10 Meta Ads tools need an active plan or trial. Paid Ads is $89 per month with a 7-day free trial, and Agency is $279 per month. Annual billing takes 30% off the first year.

How to connect Codex to Meta Ads in the CLI

The first step is in Ryze AI and Meta. The remaining steps are in Codex. Every user enters the same server URL.

  1. Connect Meta Ads in Ryze AI

    Create a Ryze AI account or sign in, open Integrations in the left sidebar and find Meta Ads under Advertising. Click Connect, sign in to Meta and approve access with every requested permission checked. Back in Ryze AI the card shows Connected. There is no ad account to pick, because Ryze AI sees every ad account that login can reach.

  2. Add the Ryze AI server to Codex

    Open a terminal and run codex mcp add ryze --url https://connector.get-ryze.ai/mcp. Codex stores a Streamable HTTP server called ryze. No client ID or secret is needed at this point.

  3. Sign in and allow the workspace

    Run codex mcp login ryze. A Ryze AI page opens: sign in, pick the workspace where Meta Ads is connected and click Allow connection. On a machine with no local browser, add --no-browser, open the URL it prints elsewhere and paste the complete redirect URL into the terminal.

  4. Check the server

    Run codex mcp list. Inside the Codex TUI, /mcp shows the same list.

  5. Ask your first question

    Start Codex and ask: Which Meta ad accounts can I reach? Give name and currency. If you registered the server before linking Meta Ads in Ryze AI, remove it, add it once more and open a fresh session.

The Ryze AI help center article for Meta Ads covers the Meta side of the connection. OpenAI documents the Codex commands on its MCP page.

Codex desktop app and IDE extension

Per OpenAI, the ChatGPT desktop app, the CLI and the IDE extension read a single MCP configuration. A server registered in any of them appears in all three. The screens below follow OpenAI's Codex MCP page.

ChatGPT desktop app (Codex)

  1. Go to Settings and choose MCP servers.
  2. Pick Add server. Name it ryze, set the type to Streamable HTTP and paste https://connector.get-ryze.ai/mcp as the URL.
  3. Save and choose Restart so the app reloads its servers.
  4. Click Authenticate beside ryze and finish the Ryze AI sign-in. Typing /mcp in the composer lists connected servers.

Codex IDE extension

  1. Click the gear icon and choose MCP servers.
  2. Pick Add server with the name ryze, the type Streamable HTTP and the URL https://connector.get-ryze.ai/mcp.
  3. Save and choose Restart extension.
  4. Click Authenticate and sign in to Ryze AI.

Free and Go users should follow the desktop app steps, because OpenAI's pricing page limits those plans to the desktop app. Codex cloud tasks are outside what OpenAI's MCP page describes, so nothing here promises Ryze AI works in them. We did not run the Ryze AI connector through Codex end to end for this guide; the steps follow OpenAI's documentation.

config.toml

You can skip the command and write the entry yourself in ~/.codex/config.toml, or in .codex/config.toml inside a trusted project. Sign-in uses OAuth by default, so finish with codex mcp login ryze.

[mcp_servers.ryze] url = "https://connector.get-ryze.ai/mcp" startup_timeout_sec = 20 tool_timeout_sec = 120 default_tools_approval_mode = "writes"

Out of the box Codex allows 10 seconds for startup and 60 seconds per tool call. The two timeout lines double or more those allowances for this server, useful when a wide Insights query is slow. The final line selects the approval mode explained under the tools table. In scripts, a Ryze AI API key can replace OAuth: add bearer_token_env_var = "RYZE_API_KEY" to the table and export that variable with the rk_live_ key.

Other clients in brief

Other MCP clients take the same URL. Meta stays connected through Ryze AI, so the Meta side needs no change.

Claude Code

Register the server with the command below and sign in through /mcp. Claude Code requires a Pro, Max, Ultra, Team or Enterprise account, or Console access. A Claude-specific Meta Ads guide is listed under related guides.

claude mcp add --transport http ryze https://connector.get-ryze.ai/mcp --scope user

Cursor

Put the entry below in ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project) and complete the Ryze AI sign-in when Cursor prompts.

{ "mcpServers": { "ryze": { "url": "https://connector.get-ryze.ai/mcp" } } }

Claude and ChatGPT

In claude.ai open Customize, Connectors, Add custom connector and enter the same URL. ChatGPT custom MCP servers are on Business and Enterprise or Edu plans, and Pro gets read and fetch permissions only, per OpenAI's help article.

Permissions and access

Two logins are involved: Ryze AI signs in to Meta, and Codex signs in to Ryze AI. Four settings decide what Codex can do with your ads.

Which Meta login
The one you approve in Ryze AI. One login reaches every ad account it can access, and Codex can only reach accounts that login has access to. Its role on each account (Advertiser or Admin) decides whether changes are allowed.
Which scopes Meta shows
Ryze AI requests ads_management, ads_read, business_management, pages_show_list, pages_read_engagement, pages_manage_ads, leads_retrieval, catalog_management, instagram_basic, instagram_manage_comments and public_profile. Approve with every permission checked.
Which workspace Codex sees
On the Ryze AI page you choose the workspace and click Allow connection. One Ryze AI connection can cover up to 20 workspaces.
What Codex may change
Three of the 10 tools write or delete: runGraphWrite, uploadImageFromUrl and runGraphDelete. Codex has its own approval setting per server, described in the tools section.

Removing access

Three places can cut access. In Ryze AI, click View on the Meta Ads card and disconnect the login. In the desktop app or IDE extension, delete the server from the MCP servers screen. In config.toml, remove the [mcp_servers.ryze] table. If Codex must never change anything, connect a Meta login that holds read access only.

What Codex can do in Meta Ads

Ryze AI offers Codex 10 Meta Ads tools, split into 7 read, 2 write and 1 delete. Each name carries the prefix meta_ads__. Every one accepts an optional connection_id for choosing among several connected Meta logins.

ToolTypeWhat it does
listAdAccountsReadShows each ad account reachable by the connected login: id, name, currency.
getAccountSummaryReadTotals for one ad account, calculated on Meta's default attribution window.
runRawInsightsReadFree-form Insights query at any level from account to ad, with breakdowns, filters and attribution windows of your choosing.
listCreativesReadEnumerates the creatives stored in an ad account.
getCreativeReadFetches a single creative when you give its id.
listLeadFormsReadReturns the lead forms attached to a Facebook Page.
runGraphReadReadReads any Graph API object or edge, for example paused campaigns, targeting specs or the account activity log.
runGraphWriteWriteCreates or edits campaigns, ad sets, ads, creatives and similar objects via the Graph API.
uploadImageFromUrlWritePulls an image from a URL into the ad account and gives back an image hash to use in a creative.
runGraphDeleteDeleteDeletes or archives Meta objects; its own description says to use it on an explicit, item-by-item approved list.

Approvals

The Ryze AI chat has its own Tool approvals setting, which starts on Skip all approvals, and scheduled tasks run with no approval step. Codex brings a separate control: default_tools_approval_mode for the ryze server accepts auto, prompt, writes or approve, where writes means prompting for tools not marked read-only. You can also override one tool, for example tools.meta_ads__runGraphWrite.approval_mode = "prompt", or hide tools with disabled_tools, which acts as a deny list. Whether Ryze AI marks its read tools as read-only was not tested, so try writes first and switch to prompt if a read tool does not run freely.

Limits to expect

Creative writes run at roughly one per 30 seconds per account, according to the tool description, and that pacing comes from Meta. Meta also meters calls per ad account over one hour and lists error codes 17, 613 and 80004 among its limit errors. Sessions can lapse sooner than on other platforms, since the Ryze AI help center calls for a reconnect after two-factor or Business Manager role changes. Outside the scope: organic Page and Instagram posts, Page comments, and restoring archived or deleted objects. getAccountSummary stays on Meta's default attribution window; use runRawInsights for others.

First 3 prompts to run

Each prompt lists what to expect rather than sample figures, since results come from your own ad accounts. Codex runs them from any working directory, so you can keep a landing page repository open alongside.

1. Spend and ROAS by campaign

For the ad account named in this message, show Meta spend, ROAS and CTR for the last 14 days by campaign, and list the three campaigns whose ROAS fell the most compared with the 14 days before.

Tools used: listAdAccounts, runRawInsights

What comes back: A campaign table with spend, ROAS and CTR for two windows, and a short ranked list of the campaigns that declined. The figures come from your account.

2. Audience breakdown

Break down Meta results for my best ad set by age, gender and placement. Tell me which segment has the lowest cost per result and which has the highest spend share.

Tools used: runRawInsights

What comes back: Breakdown rows per segment and a plain-language comparison. Meta only returns breakdowns it supports for the objective and level you ask about.

3. Landing page against the ad

List the active creatives in my Meta ad account with their headline and destination URL. Compare each destination with the matching page in this repository and flag any mismatch in offer or wording.

Tools used: listCreatives, getCreative

What comes back: A creative list with destination URLs and a note per creative on how it matches the local page. Nothing changes in Meta unless you ask for an edit.

Ryze AI vs Meta's own ads MCP server

Two servers are worth comparing. Meta introduced ads AI connectors in open beta on April 29, 2026, made of an ads MCP server and an Ads CLI, and a July 16, 2026 update lets you connect an AI application through your own developer app.

OptionSetupCoverageWorks in
Ryze AI connectorMeta sign-in inside Ryze AI, then codex mcp add and codex mcp login with one URL10 tools: ad accounts, summaries, raw Insights with breakdowns, creatives, lead forms, Graph reads, Graph writes, image upload and deleteCodex CLI, desktop app and IDE extension, plus Claude, ChatGPT and Cursor on the same URL
Meta ads AI connectorsMeta says the MCP path needs no developer credentials, API setup or coding. The connection details, including the server address and supported clients, are in Meta's Business Help Center article, which this guide could not read in fullPer Meta: create and edit ads, ad sets and campaigns in natural language, performance reports, catalog management and signal diagnosticsMeta says the AI tools you already use and does not name Codex on its announcement page

Pick Meta's connector if you want only Meta's server; check its help center for the present state because it is in beta. Pick Ryze AI if you want the tool list above on one URL that also serves other platforms connected to the same workspace, plus Managed Campaigns and the Ads Performance dashboard in the app. Whether Meta's connector runs in Codex was not verified here.

Sources: OpenAI: Codex MCP, OpenAI: Codex pricing, Meta: ads AI connectors announcement, Meta: ads AI connector help article, Meta: Marketing API rate limiting, Ryze AI Meta Ads guide. Checked November 11, 2026.

Errors and fixes

The Ryze AI server shows no Meta Ads tools
If the server was added before Meta Ads was connected, remove it, add it again and start a new session. The card in the Ryze AI app should read Connected.
Meta asks you to reconnect
Meta access expires after two-factor or Business Manager role changes. Click Reconnect on the Meta Ads card in Ryze AI and approve every permission again.
codex mcp login cannot open a browser
Use codex mcp login ryze --no-browser, open the URL it prints on any other device, then paste the whole redirect URL into the terminal.
The server times out at startup or during a call
Codex gives a server 10 seconds to start and 60 seconds per tool call unless told otherwise. Raise startup_timeout_sec and tool_timeout_sec in the ryze table of config.toml, particularly for large Insights queries.
Meta returns a rate limit error
Meta applies business use case rate limits per ad account over one hour, with error codes such as 17, 613 and 80004. Wait and retry with fewer or narrower requests.
A write is refused
Check the role of the connected Meta login on that ad account. Admin access is needed to allow changes, and a read-only login cannot write.
Creative writes are slow
Meta rate-limits creative writes to about one per 30 seconds per account, per the tool description. Batch creative work and expect a pause.
Codex says a subscription is required
No active Ryze AI plan or trial is on the workspace. Start the trial in Ryze AI, then try again.
I need a different ad account
One login reaches every ad account it can access, so name the account in your prompt. Agent default accounts in the Meta Ads card sets which accounts Ryze AI uses first.

Frequently asked questions

How do I connect Codex to Meta Ads?

Ryze AI is the best way to connect Codex to Meta Ads when you want tools for Insights, creatives and campaign changes behind one URL, though it needs a Ryze AI plan or trial. Connect Meta Ads in Ryze AI, run codex mcp add ryze --url https://connector.get-ryze.ai/mcp, run codex mcp login ryze and click Allow connection.

Is there a Meta Ads MCP server for Codex?

The Ryze AI connector at https://connector.get-ryze.ai/mcp provides 10 Meta Ads tools and is a remote MCP server that Codex can add. Meta also describes its own ads MCP server in open beta since April 29, 2026. This guide did not verify that it works in Codex.

Which Codex plan do I need?

OpenAI lists Codex in ChatGPT Free, Go, Plus, Pro, Business, Edu and Enterprise plans. Free and Go get the desktop app only, subject to rollout, and Plus and higher add the CLI and IDE extension. You can also use an OpenAI API key in the CLI, SDK or IDE extension.

Does this work in the Codex desktop app and the IDE extension?

OpenAI documents one shared MCP configuration for the ChatGPT desktop app, the CLI and the IDE extension. Add the server through MCP servers, choose Streamable HTTP, enter the URL, restart and select Authenticate. Codex cloud tasks are not covered by OpenAI's MCP page, so this guide does not claim them.

What can Codex do in my Meta ad accounts?

Through Ryze AI it can list ad accounts, read account summaries and raw Insights with breakdowns, list and inspect creatives and lead forms, read any Graph object, create or update campaigns, ad sets, ads and creatives, upload images from a URL and delete or archive objects. That is 7 read, 2 write and 1 delete tool.

Can Codex change my campaigns without asking?

That depends on the approval settings. In Codex set default_tools_approval_mode to prompt or writes for the ryze server, or set approval_mode per tool, so Codex asks before a write or delete tool runs. In the Ryze AI chat the default is Skip all approvals, and you can switch it to Approve write and delete or Manual approve.

Can I make it read-only?

Yes. Connect a Meta login that only has read access, which is a hard guarantee. You can also add the three write and delete tools to disabled_tools in config.toml, or set their approval mode to prompt.

Can I connect more than one ad account?

One Meta login reaches every ad account it can access, so name the account in your prompt. You can also connect several Meta logins to one workspace. For separate clients use one Ryze AI workspace per client; one connection can cover up to 20 workspaces.

Why does Codex not show Meta Ads tools?

If you added the server before connecting Meta Ads in Ryze AI, remove it, add it again and start a new session. Also check that the Meta Ads card in Ryze AI shows Connected, and reconnect if Meta access expired.

Can Codex post to my Facebook Page or Instagram?

No. The Ryze AI Meta app does not hold the permissions for organic Page or Instagram posts or for reading Page comments. It covers paid ads: Insights, creatives, lead forms, campaigns, ad sets and ads.

How much does it cost?

Adding the server is free, but the tools need an active Ryze AI plan or free trial. Paid Ads is $89 per month with a 7-day free trial, and Agency is $279 per month. Annual billing takes 30% off the first year.

How do I disconnect it?

Remove the server in the MCP servers screen of the desktop app or IDE extension, or delete the [mcp_servers.ryze] table from config.toml. To cut Meta access, click View on the Meta Ads card in Ryze AI and disconnect the login.

Connect Meta Ads to Codex

The Meta Ads tools need an active Ryze AI plan or trial. Paid Ads is $89 per month with a 7-day free trial, and Agency is $279 per month. Annual billing takes 30% off the first year.

Meta Ads with Ryze AI

Need help? Read the Ryze AI help center or email Ryze AI support.