You have a protected inventory sync route that should run before each workday, and you would rather configure it from the same place you work on the code. This guide connects Codex to Crontap, creates a recurring POST to https://api.example.com/sync/inventory, then adds 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 Codex host 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-09-15.
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 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 use Crontap tools to verify the resource. A connected MCP server and a saved schedule are separate checkpoints. Retrieve the returned schedule ID and inspect every field.
After the first run, ask Codex for schedule history. Compare the recorded HTTP status and duration with your endpoint logs. If Crontap records a 500, it did call the endpoint and your application returned an error. If it records 401 or 403, inspect endpoint credentials. If it records no run 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. Check both authentication layers when a sync returns 401 or 403.
Before changing or deleting a schedule, list and retrieve it. Similar names are easy to mix up; confirm the ID first.
Codex scheduled task or Crontap schedule?
OpenAI's current scheduled-tasks documentation places task management in ChatGPT web or the desktop app. Codex CLI and the IDE extension can help prepare and test prompts, but they do not provide the Scheduled management interface.
Use a Codex or ChatGPT scheduled task when each run should execute an agent prompt, inspect a project, or use connected tools. Desktop project tasks may require the machine to remain on and the app to keep running. Web tasks cannot work directly in a local folder.
Use Crontap when the repeated action is a plain HTTP call. Your endpoint remains the unit of execution, and Crontap retains the request outcome. Codex is the convenient management surface, not the clock.
You can combine the mechanisms intentionally. For example, a Codex task may review a repository each morning, while a Crontap heartbeat alerts if a separate deployed worker stops checking in. The heartbeat still does not launch the worker.
Troubleshooting
codex mcp login cannot complete OAuth
Check that the URL is exactly https://mcp.crontap.com/mcp, then retry login. Loopback callback security software or a corporate proxy can interrupt the browser return.
The IDE extension cannot see the server
Codex clients share configuration for the same host, but the extension may need a restart. Open its gear menu, select MCP servers, and confirm Crontap is enabled and authenticated.
The tools are connected but Codex chooses another tool
Name Crontap and the specific tool in your prompt. Tell Codex not to use browsing or another scheduler. 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.
- Read Scheduled tasks for AI-built apps for safe endpoint patterns.
Ready to schedule the protected sync? Free forever tier. No credit card. Create your Crontap account →
Verified with current Codex MCP and scheduled-task documentation on 2026-09-15. 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 runs a saved agent prompt. Crontap owns recurring HTTP requests and retains execution evidence for the endpoint call.
- Can I use Crontap from the Codex IDE extension?
- Yes. The IDE extension shares Codex MCP configuration. You can also add a Streamable HTTP server from the extension's gear menu under MCP servers.
- 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.
