As of 2026-11-11, the native way to run a Codex cron job is a scheduled task (OpenAI's URL still says automations). It runs a saved prompt on minute-based, daily or weekly intervals inside a chat, on an RRULE schedule, or when a Gmail, Slack or GitHub event arrives, and you manage it from ChatGPT web or the desktop app, not the CLI. What it cannot do is send a recurring HTTP request to your own endpoint, retry it when it fails, keep a run history of status codes, and alert you when it breaks. Crontap's MCP server covers that part: Codex calls its tools to create and check a hosted HTTP schedule, and Crontap sends the request on time whether Codex is open or not.
This guide connects Codex to Crontap and creates a recurring POST to https://api.example.com/sync/inventory, a protected inventory sync that should run before each workday. You then add endpoint authorization on the Crontap schedule page. Crontap owns the HTTP schedule. It does not schedule a Codex conversation.
Before you start
- Install a current Codex CLI or IDE extension and sign in normally.
- Have a Crontap account and a public HTTPS endpoint that is safe to retry.
- Prepare an endpoint token and an optional non-secret idempotency key. Keep the token out of project configuration, Codex chat, and reusable prompt text.
- Codex CLI, the IDE extension, and the ChatGPT desktop app share MCP configuration. Project-scoped
.codex/config.tomlis loaded only for trusted projects. - Verified against the Codex MCP guide and scheduled tasks guide on 2026-11-11.
Connect Codex to Crontap MCP
Codex CLI
codex mcp add crontap --url https://mcp.crontap.com/mcp
codex mcp login crontapUse Codex CLI or the Codex IDE integration, then complete MCP login.
Step 1
Add the Streamable HTTP server
Run the command in a terminal. Codex stores the server in
~/.codex/config.toml unless you intentionally use project configuration.
Expected result: Codex adds a crontap server entry with the production URL.
codex mcp add crontap --url https://mcp.crontap.com/mcpStep 2
Complete Crontap OAuth
Run the login command and approve access in your browser. Then use codex mcp list, or /mcp in the terminal UI or the desktop app composer, to inspect
active servers. Expected result: Crontap is connected and its tools are
visible.
codex mcp login crontap- Crontap
- Connected
- Authentication
- OAuth 2.1
Step 3
Preview the pre-workday cadence
Ask Codex to preview “weekdays at 6:45am” in Asia/Singapore without writing.
preview_schedule should report a cron expression, timezone, and next runs.
Make sure the dates really are weekdays in the intended zone.
Step 4
Create the base sync call
Ask Codex to create a POST schedule named weekday inventory sync for
https://api.example.com/sync/inventory. If useful, include a non-secret
Idempotency-Key such as inventory-sync-weekday. Codex approval is
approve-or-deny, so keep the authorization token out of the chat and tool
input.
Step 5
Add authorization in Crontap
Ask Codex to retrieve the schedule ID and verify its URL, method, cadence,
timezone, and state. Then open that schedule on the Crontap schedule page, add
the Authorization request header there, save it, and perform a test request.
Crontap MCP omits request headers from list and get output, so verify headers
on the schedule page.
Ask Codex with copyable prompts
Use only Crontap MCP. Preview "weekdays at 6:45am" in Asia/Singapore without changing a schedule. Show the resolved cron, timezone, and three upcoming runs.Prepare a POST schedule named "weekday inventory sync" for https://api.example.com/sync/inventory using the cadence we previewed. Add the non-secret Idempotency-Key value "inventory-sync-weekday". Show the URL, method, cadence, timezone, and non-secret key before asking me to approve create_schedule. Leave Authorization for the Crontap schedule page.List my Crontap schedules, retrieve "weekday inventory sync" by ID, and report its URL, method, status, timezone, and next run. Give me the schedule ID so I can open its Crontap schedule page and add the Authorization header there. Keep the schedule unchanged.Verify the Codex cron job worked
Use codex mcp list to verify client connectivity, then retrieve the returned schedule ID and inspect every field. A connected server and a saved schedule are separate checkpoints.
After the first run, ask Codex for schedule history. Compare the recorded HTTP status and duration with your endpoint logs. A recorded 500 means Crontap reached the endpoint and your application returned an error. A 401 or 403 points at endpoint credentials. If no run appears after the expected time, confirm the schedule is active and that the timezone places the next run where you expect.
For sensitive request headers, keep tokens out of reusable prompts, Codex chat, and checked-in project configuration. The MCP login authenticates Codex to Crontap; the header you add on the Crontap schedule page authenticates the scheduled request to the destination endpoint. Crontap MCP intentionally removes headers from list_schedules and get_schedule output, so use the schedule page to confirm them. Before changing or deleting a schedule, list and retrieve it, and confirm the ID: similar names are easy to mix up.
Codex scheduled task or Crontap schedule?
OpenAI's page is titled "Scheduled tasks", but its URL still says automations, so both names mean the same feature. Codex CLI and the IDE extension can help you draft and test the prompt, but they have no scheduling interface. Event triggers are set up in ChatGPT on the web or mobile.
| Question | Codex scheduled tasks | Crontap schedule |
|---|---|---|
| What repeats | A saved Codex prompt | An HTTP request to your URL |
| Cadence | Intervals, daily, weekly, RRULE | Cron expression, IANA timezone |
| Event triggers | Gmail, Slack, GitHub (some plans) | None, time only |
| Managed from | ChatGPT web or desktop app | Crontap, or Codex through MCP |
| Needs your computer | Yes, for local project tasks | No |
| When a run fails | You read the task result | Retries, run history, alerts |
Last verified 2026-11-11 against OpenAI's Codex docs.
Use a scheduled task when each run should execute an agent prompt, inspect a project, or use connected tools. Local desktop project tasks need the computer on, the ChatGPT desktop app running, and the project on disk. Web tasks cannot work in a folder on your computer. Team Tasks run in the cloud through the team's service account.
Use Crontap when the repeated action is a plain HTTP call. Your endpoint does the work, new schedules retry 5xx responses, timeouts and network failures by default, and failures reach you by email (or Slack, Discord and Telegram on paid plans). Codex is the management surface, not the clock.
Add scheduled tasks or cron jobs to an app built with OpenAI Codex
If Codex wrote your app and you now need it to do something every night, the app needs two pieces. First, an HTTP endpoint that performs one run of the job, checks a secret header, and is safe to call twice. Ask Codex to write that route and deploy it with the rest of the app. Second, an external schedule that calls the endpoint on a real clock, which is what the steps above create. A Codex scheduled task runs an agent prompt, not your deployed code. Scheduled tasks for AI-built apps covers the endpoint patterns in more depth.
Troubleshooting
codex mcp login cannot complete OAuth
Check that the URL is exactly https://mcp.crontap.com/mcp, then retry login. Security software or a corporate proxy can interrupt the browser callback. On a remote machine or a terminal without a browser, run codex mcp login crontap --no-browser and open the authorization link yourself.
The IDE extension cannot see the server
Clients on the same machine share configuration, but the extension may need a restart. Open its gear menu, select MCP servers, and confirm Crontap is enabled and authenticated. To add it from there, choose Add server, pick Streamable HTTP, paste the URL, and restart the extension.
Codex chooses another tool
Name Crontap and the specific tool in your prompt. Preview first, then write in a separate turn.
A project config is ignored
Project-scoped .codex/config.toml is for trusted projects. Confirm the project trust state or move a personal server to ~/.codex/config.toml.
The endpoint receives duplicate work
HTTP retries and manual testing can repeat calls. Make the route idempotent with a stable execution key, unique business date, or database constraint.
Next steps
- Return to the Crontap MCP hub for all schedule and history tools.
- Compare the editor setup in Cursor and terminal setup in Claude Code.
- Learn what can actually run on a schedule when you use MCP.
Once Codex has created the weekday inventory sync, add the Authorization header on its schedule page and run one test before the first 6:45am run. Schedule your first job →
Verified against current Codex MCP and scheduled tasks documentation on 2026-11-11. Sources: Codex MCP and Codex scheduled tasks.
FAQ
Codex cron job questions
- How do I add Crontap MCP to Codex?
- Run codex mcp add crontap --url https://mcp.crontap.com/mcp, then codex mcp login crontap. Codex CLI and its IDE extension share the same MCP configuration.
- Where does Codex store MCP configuration?
- Codex uses ~/.codex/config.toml by default. A trusted project can also use .codex/config.toml for project-scoped server configuration.
- Does a Codex scheduled task replace Crontap?
- No. A Codex scheduled task (also called an automation) runs a saved agent prompt on an interval, an RRULE schedule or an event trigger, managed from ChatGPT web or the desktop app. Crontap sends recurring HTTP requests to your endpoint with retries, run history and failure alerts.
- Can I use Crontap from the Codex IDE extension?
- Yes. The IDE extension shares Codex MCP configuration. You can also open the extension's gear menu, choose MCP servers, Add server, Streamable HTTP, paste the URL and restart the extension.
- How do I add a secret header to a Codex-created schedule?
- Create the URL, method, and cadence from Codex, then open the returned schedule in Crontap and add Authorization on the schedule page. Keep the secret out of Codex chat; MCP list and get results omit request headers.
