Zernio for OpenAI Codex
Add the server
Writes the entry to ~/.codex/config.toml.
Run Instagram from Codex
Answer DMs, reply to comments, run Meta Ads campaigns, send conversions to the Meta Conversions API, run catalog ads, read analytics and publish posts on Instagram, from Codex. Codex can run the same prompt as a scripted codex exec job, so a daily platform check asks the same question and answers in the same shape every time.
- Inbox
- Meta Ads
- Conversions
- Catalog ads
- Analytics
- Publishing
Instagram DMs and comments counted by a script, answered by you with Codex
Codex runs from the CLI, the IDE extension or a codex exec job with no screen. Put a platform check in a script and cron or CI runs it every morning; when a run turns up something, pick the thread up in the IDE.
- 01
Save the prompt: "count Instagram DMs and comments waiting more than 24 hours and draft replies to out/drafts.md without sending".
- 02
A scheduled codex exec run reads the conversations through Zernio and writes the counts and drafts.
- 03
You read out/drafts.md, edit what needs it, and ask Codex in the CLI to send the approved ones.
A morning Meta Ads check from codex exec
- 01
Save the prompt in your repo: "list Meta Ads ad sets that spent yesterday with zero results, as JSON".
- 02
A cron job or CI step runs codex exec with it each morning; Codex reads the ad sets through Zernio.
- 03
codex exec prints the final answer to stdout, so the script saves it or posts it wherever your team looks.
- 04
When the list is long, open the session in the Codex IDE extension and decide what to pause there.
How people run Instagram from Codex
Unanswered Instagram DMs and comments counted every morning
A cron entry runs codex exec with one saved prompt. Codex counts Instagram DMs and comments older than a day and writes them to a file, so the same question gets the same kind of answer daily.
Script finds it, the IDE finishes it
When the morning run flags one of the Instagram threads, open Codex in your editor, read the conversation through Zernio and write the reply there. Same config file, same server, no second setup.
Event check before a launch
Before a campaign goes live, a codex exec step sends one test event per event name to the Meta Conversions API and fails the job if any is rejected.
Codex and Instagram in 4 steps
Codex reaches Instagram through the Zernio MCP server. No Zernio server to host and no Instagram developer app of your own.
01
Connect Instagram
Sign up free and connect an Instagram Business or Creator account in Zernio.
Connect Instagram02
Add the server
Writes the entry to ~/.codex/config.toml, which the Codex CLI and IDE extension share.
03
Sign in
Approve the connection in the browser window Codex opens.
04
Check it works
Run codex mcp list and confirm zernio is listed and connected.
Good to know in Codex
- codex mcp add writes zernio to ~/.codex/config.toml, which the CLI, the IDE extension and codex exec runs all read.
- codex exec prints only the final message to stdout, and -o saves it to a file, so a script can keep or forward the answer.
- Codex asks before tool calls according to its approval settings; for unattended runs, write prompts that draft and report rather than send.
What Codex can do on Instagram
Codex can run the same prompt as a scripted codex exec job, so a daily platform check asks the same question and answers in the same shape every time.
Inbox
Counts Instagram DMs and comments waiting too long in a scheduled run and drafts replies to a file, sending only after you say so.
- Read and send DMs with images, video and audio, quick replies, buttons and carousels.
- List, post, reply to, hide and delete comments, and send a private DM reply to a commenter.
Ads
Lists Meta Ads ad sets with spend and no results every morning, and pauses the ones you name in a later run.
Campaigns and boosted posts on Meta Ads, from a separately connected ad account.
Meta Ads with ZernioConversions
Sends a test event per event name to the Meta Conversions API from a CI step and reports which were accepted.
Meta Conversions API: purchases, leads and sign-ups sent server-side to your Meta pixel (dataset), deduplicated against the browser pixel.
Conversions API docsCatalog ads
Diffs the Meta catalog against a products file in your repo and writes the mismatches to JSON.
Advantage+ catalog ads that promote a product set from your Meta product catalog.
Analytics
Writes Instagram numbers to dated files in the repo, so each run can be compared with git diff.
Impressions, reach, likes, comments, shares, saves and views per post, plus account insights, daily follower history, audience demographics (100+ followers) and Story insights while a Story is live.
Publishing
Queues the Instagram announcement once a release tag lands, last in the run after the checks.
- Feed posts with a single image
- Carousels of up to 20 images and videos, mixed
Ask in plain words. Codex picks the tools.
Written for how Codex works. Copy one, change the details.
Write the prompt once, run it on a schedule, in Codex
Instagram rules the agent runs into
Set by Instagram's API or by Zernio, whichever agent you use. Checked against the Zernio Instagram docs on December 4, 2026.
- Personal Instagram accounts cannot post through the API; only Business and Creator accounts can.
- Every post needs media, so there are no text-only posts.
Connecting Codex is free. Its calls bill like the API requests behind them.
Each Instagram account counts as one connected account. The first 2 connected accounts are free, then $6 per account a month, falling to $1 as you add more.
Frequently Asked Questions
Connect an Instagram Business or Creator account in Zernio first. Then, in Codex: add the server and sign in. Run codex mcp list and confirm zernio is listed and connected.
In ~/.codex/config.toml, which codex mcp add writes. The CLI, the IDE extension and codex exec all read it, so one setup covers all three.
Yes, with codex exec. It runs a prompt without the interactive screen, prints only the final message to stdout, and -o writes that message to a file. It expects a Git repository unless you pass --skip-git-repo-check.
codex exec --json streams events as JSON Lines, and --output-schema holds the final answer to a JSON Schema you supply, so counts and lists arrive in fixed fields.
Codex follows its approval settings for tool calls. For unattended runs, write the prompt to draft and report, then send from an interactive session after you have read the drafts.
Yes. codex exec resume --last, or resume with a session id, picks up a previous run with its context, so you can ask follow-up questions about what it found.
Per post: impressions, reach, likes, comments, shares, saves and views. Account insights, daily follower history and audience demographics are also available, and Story insights can be read while the Story is live.
Give Codex your Instagram account
Connect an Instagram Business or Creator account, add Zernio to Codex, and ask.
- Inbox
- Meta Ads
- Conversions
- Catalog ads
- Analytics
- Publishing