Control your App Store release from Codex
Pick how version 2.4 goes live once it's approved: by hand, automatically, or on a date. Then start a phased rollout, pause it when a crash report lands, and finish it when the numbers look right, all by asking Codex.
Setup checked October 2026 against Codex MCP docs, non-interactive mode
Connect Codex once
01 · Add the server
Codex sees that MetaRun offers sign-in and starts it straight away, in your browser. Pick read-only or read and change.
codex mcp add metarun --url https://metarun.dev/api/mcp02 · Sign in again later
If the sign-in expires or you disconnected it in MetaRun's settings. --no-browser prints the link instead, for SSH sessions.
codex mcp login metarun03 · Or edit ~/.codex/config.toml
The Codex CLI, the IDE extension and Codex in the ChatGPT desktop app read the same file, so one entry covers all three.
[mcp_servers.metarun]
url = "https://metarun.dev/api/mcp"Prefer a personal access token (scripts, CI)?
Add the server with a token
Mint a personal access token in MetaRun under Settings, MCP. It's shown once and can be revoked any time. Codex reads it from the environment variable you name.
export METARUN_TOKEN="mr_pat_..."
codex mcp add metarun --url https://metarun.dev/api/mcp --bearer-token-env-var METARUN_TOKENOr in config.toml
[mcp_servers.metarun]
url = "https://metarun.dev/api/mcp"
bearer_token_env_var = "METARUN_TOKEN"What Codex handles here
Release settings live in two places in App Store Connect: the version's release option (manual, automatic after approval, or a scheduled date) and the phased release toggle. After launch the phased release has its own pause and resume controls. None of it is hard, but it's always needed at the moment you're watching crash numbers somewhere else.
MetaRun exposes each control as a preview and apply pair. Codex can read the version's state, change the release option before approval, release a version that's waiting for you, and move a phased rollout through start, pause, resume, complete or cancel.
Before you start
- A version that's approved and waiting, or already live with phased release on.
- For release options: a version that hasn't been submitted yet.
- An API key with the Admin or App Manager role.
How it runs
- 01
Read where the version stands
Codex reads the version state first. Release options only change before submission; a manual release only applies to a version that's waiting for developer release.
- 02
Preview the transition
Every control previews the exact transition, for example phased release from active to paused, with a confirm token tied to the current state.
- 03
Apply on your approval
Codex asks before running the apply. If the rollout moved in the meantime (someone paused it in App Store Connect), the token is stale and the apply refuses.
- 04
Check the history
Each change lands in MetaRun's change history, attributed to the agent, next to manual and MILO changes for the same app.
An example session in Codex
Set 2.4 to release automatically after approval with a phased rollout.
- apple_list_versionsVersion 2.4 is Ready for Sale, phased release active.
- apple_list_reviewsSeveral new reviews mention a crash on launch since 2.4.
- apple_preview_phased_releasePreview: pause, from Active to Paused.
- Codex asks before running apple_apply_phased_release. You read the preview above and approve.
- apple_apply_phased_releasePaused. Automatic updates stop; people can still update by hand.
Illustrative: your apps, versions and numbers will differ. The tool names and their order are real.
The MetaRun tools Codex calls
| Tool | What it does |
|---|---|
| apple_list_versionsread | Versions with their state, so the agent knows what's approved and what's live. |
| apple_preview_set_release_optionspreview + apply | Manual, automatic after approval, or scheduled with an earliest release date. |
| apple_preview_phased_releasepreview + apply | Start, pause, resume, complete or cancel a phased rollout. |
| apple_preview_manual_releasepreview + apply | Release an approved version that's waiting for you. Irreversible. |
| apple_preview_set_territory_releasepreview + apply | Change availability, release date or pre-order for individual territories. |
| apple_get_perf_metricsread | Apple's performance metrics for the app, to check before widening a rollout. |
| apple_list_reviewsread | Recent customer reviews, to catch complaints about the new version. |
Each preview has an apply twin (the same name with apply instead of preview) that only runs with the confirm token from a fresh preview, and refuses if App Store Connect changed in between. MetaRun tools save to your MetaRun workspace only (studio projects, tracked keywords), never to Apple.
What Apple enforces, and how MetaRun handles it
A phased release runs for 7 days
Apple widens automatic updates over seven days: 1%, 2%, 5%, 10%, 20%, 50%, then everyone. New downloads and manual updates get the new version from day one.
Pausing has a 30-day budget
You can pause a phased release for up to 30 days in total. Completing it releases to all users at once.
Releasing is irreversible
A manual release can't be undone, which is why the preview says so and the tool is marked outward. Pulling a bad version means a new build, not a rollback.
Release options lock at submission
MetaRun changes a version's release option while the version is being prepared, ready for review or rejected, the states where App Store Connect accepts edits to it. Set it before you submit.
What to ask Codex
- Ask Codex: Set 2.4 to release automatically after approval with a phased rollout.
- Ask Codex: Crash rate on 2.4 just doubled. Pause the phased release now and show me the last 20 reviews.
- Ask Codex: Everything looks fine after three days. Complete the phased release for 2.4.
Run it from a script with Codex
codex exec runs one request without an interactive session and with its approval policy set to never. MetaRun's reads and previews still run, because they're marked read-only; anything that would ask is refused.
Read-only check, safe to schedule
codex exec "Report the state of the latest version of com.example.app and its phased release, including the current rollout day. Read only."Applies are refused in codex exec by design. Don't set MetaRun's approval mode to approve just to make them pass; keep App Store changes in an interactive session.
How Codex asks before a change
Codex decides per tool from the hints MetaRun sends with each one. In its default mode it runs tools marked read-only, which covers MetaRun's reads and previews, and asks before the rest, which covers every apply. You can change that per server with default_tools_approval_mode, or per tool with tools.<name>.approval_mode in config.toml; keep the apply tools on prompt.
Frequently asked questions
Can Codex pause a phased release?
Yes. apple_preview_phased_release covers start, pause, resume, complete and cancel. The apply runs after you approve it in Codex, and it refuses if the rollout's state changed since the preview.
Can I schedule a release for a specific date?
Yes, before you submit: set the release option to scheduled with an earliest release date. Apple releases on or after that date once the version is approved.
Can MetaRun roll back a release?
No, and neither can Apple. A released version stays released. You can pause a phased rollout to stop automatic updates while you ship a fix.
Is this different from releasing in App Store Connect?
It's the same Apple API calls behind the same buttons. The difference is that Codex reads the state first, previews the transition, and every change is recorded in your history.
How do I connect Codex to App Store Connect?
Run codex mcp add metarun --url https://metarun.dev/api/mcp; Codex detects MetaRun's sign-in and opens it in your browser. After that, ask for "phased release" in plain words and Codex picks the MetaRun tools.
Does Codex see my App Store Connect key?
No. Your App Store Connect API key stays envelope-encrypted on MetaRun's servers and is decrypted per request. Codex holds a MetaRun token that you can revoke in Settings at any time.
More with Codex
Codex
Submit for review
Attach the build, clear export compliance, run the readiness sweep, submit.
OpenCodex
Release notes
Write What's New from your changelog and stage it in every language.
OpenCodex
Reply to reviews
Triage App Store reviews, find the themes, and post replies you've approved.
OpenCodex
TestFlight
Hand builds to tester groups, write What to Test, and read crash feedback.
OpenPhased release with another agent
In depth: App Store Connect MCP server
Agent access
14-day free trial with agent access. No credit card. Your Apple key stays encrypted on MetaRun.