Codex · App Store Connect

Create subscriptions and in-app purchases from Codex

Describe the products you want, and Codex creates them in App Store Connect: the subscription group, each subscription with its copy in every language, prices for every storefront, and the review screenshot Apple wants before the first submission.

Setup checked October 2026 against Codex MCP docs, non-interactive mode

01 · Uplink

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/mcp

02 · 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 metarun

03 · 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_TOKEN

Or in config.toml

[mcp_servers.metarun]
url = "https://metarun.dev/api/mcp"
bearer_token_env_var = "METARUN_TOKEN"
02 · Briefing

What Codex handles here

Setting up a subscription by hand takes a group, a reference name, a product id you can never reuse, a duration, a display name and description per language, a price schedule, availability, and a review screenshot. In-app purchases need most of the same.

Codex can do the whole chain through MetaRun. Creates return the new product's id, so the next preview (copy, price, availability) can name it immediately.

03 · Preflight

Before you start

  • Product ids you're happy to keep forever: Apple never frees one.
  • Durations and prices for each plan.
  • A screenshot of your paywall for App Review.
04 · Execution

How it runs

  1. 01

    Plan the products

    Codex reads what exists, then proposes groups, product ids and durations. Product ids are permanent, so it's worth getting them right before the first apply.

  2. 02

    Create, then chain

    Each create returns the new id. Copy, prices and availability are staged against it in the same session.

  3. 03

    Price it

    Prices can come from the pricing engine (PPP, Big Mac, Spotify) or a single base price that Apple equalizes.

  4. 04

    Ready it for review

    The review screenshot is uploaded from an https URL, like app screenshots, so the subscription can go out with the next version.

05 · Session

An example session in Codex

Create a 'Pro' subscription group with monthly and yearly plans: com.example.app.pro.monthly at $4.99 and .yearly at $39.99, PPP for other storefronts.

  1. apple_list_subscription_groupsNo subscription groups yet.
  2. apple_preview_create_subscription_groupPreview: group Pro.
  3. Codex asks before running apple_apply_create_subscription_group. You read the preview above and approve.
  4. apple_apply_create_subscription_groupCreated. The group id comes back for the next step.
  5. apple_preview_create_subscriptionPreview: com.example.app.pro.yearly, one year. Product id not used before.
  6. Codex asks before running apple_apply_create_subscription. You read the preview above and approve.
  7. apple_apply_create_subscriptionCreated. The subscription id comes back.
  8. apple_preview_set_subscription_localizationPreview: English display name and a 48-character description.

Illustrative: your apps, versions and numbers will differ. The tool names and their order are real.

06 · Tools

The MetaRun tools Codex calls

ToolWhat it does
apple_list_subscription_groupsreadExisting groups and their subscriptions.
apple_preview_create_subscription_grouppreview + applyA new group with its reference name.
apple_preview_create_subscriptionpreview + applyA subscription in a group, with product id and duration. Checks for duplicate product ids first.
apple_preview_set_subscription_localizationpreview + applyDisplay name and description per language.
apple_preview_set_subscription_pricepreview + applyPrices for every storefront.
apple_preview_set_subscription_availabilitypreview + applyWhich storefronts sell it.
apple_preview_upload_subscription_review_screenshotpreview + applyThe screenshot App Review needs before the first submission.
apple_preview_create_iappreview + applyA consumable, non-consumable or non-renewing subscription purchase. Product ids are checked for duplicates.
apple_preview_set_iap_localizationpreview + applyDisplay name and description per language for an IAP.

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.

07 · Apple rules

What Apple enforces, and how MetaRun handles it

Product ids can never be reused

Once a product id exists, Apple won't accept it again, even after the product is deleted. The create preview checks the app's products for a duplicate before anything is sent.

Short descriptions

A subscription's description is capped at 55 characters, an in-app purchase's at 45. MetaRun checks before staging.

Copy belongs to a version since API 4.4.1

Subscription, IAP and group copy now belongs to a metadata version. MetaRun writes to the editable one and never opens a new version on its own.

Family Sharing is a one-way switch

Turning Family Sharing on for a product is permanent. The preview says so, and turning it off is blocked.

08 · Comms

What to ask Codex

  • Ask Codex: Create a 'Pro' subscription group with monthly and yearly plans: com.example.app.pro.monthly at $4.99 and .yearly at $39.99, PPP for other storefronts.
  • Ask Codex: Read the product ids in StoreKit/Products.storekit and create anything that's missing in App Store Connect.
  • Ask Codex: Add English, German and Japanese display names and descriptions for both plans.
09 · Unattended

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 "List every subscription group, subscription and in-app purchase for com.example.app with its state and price in the US. 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.

10 · Safety

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.

Apple key stays on MetaRun, encryptedPreview before every writeRecorded, revertible from history
11 · FAQ

Frequently asked questions

Can Codex read my StoreKit configuration file?

If it can read your project, yes. Codex reads the file; MetaRun creates and prices the products in App Store Connect. That keeps the two in sync without copying ids by hand.

What if I pick a product id I've used before?

The create preview checks the app's existing products and blocks a duplicate. Apple never frees a product id, even after deletion.

Can it set up free trials too?

Yes, as introductory offers. See the offers page for intro offers, offer codes and win-back offers.

Does the subscription go live immediately?

No. New subscriptions go out with a version submission, like in App Store Connect. MetaRun's readiness sweep checks they have what review needs.

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 "subscriptions and iaps" 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

In depth: Bulk App Store pricing

Agent access

14-day free trial with agent access. No credit card. Your Apple key stays encrypted on MetaRun.