Docs/Codex
Coding agents

Codex

Add the Sai MCP server to OpenAI Codex.

Codex reads MCP servers from ~/.codex/config.toml. The same npx command that Claude Code uses works here.

Install

InstallShell
codex mcp add sai --env SAI_API_KEY=sapi_... -- npx -y @simular-ai/sai-mcp

Or edit the config by hand:

~/.codex/config.tomlTOML
[mcp_servers.sai]
command = "npx"
args = ["-y", "@simular-ai/sai-mcp"]

[mcp_servers.sai.env]
SAI_API_KEY = "sapi_..."

Restart Codex after editing the file.

Verify

VerifyShell
codex mcp list

Then ask:

Prompt
Use Sai to open the Downloads folder on my computer and list the five newest files.

Tools and loop

The tool set and the start, wait, approve loop are the same as in Claude Code. Codex calls sai_task_wait repeatedly until status is idle. When Sai needs you on the screen (a sign-in, a captcha), Codex calls sai_live_link and gives you live_url; do the step in your browser, tell Codex, and it sends Sai a message to carry on.

Gotchas

  • Codex has no equivalent of Claude Code channels, so there is no push mode. Polling through sai_task_wait is the only path.
  • Keep the key out of the repository. ~/.codex/config.toml is per user; a project-level .codex/config.toml is committed by default in many repositories.
  • Codex applies its own timeout to tool calls, 60 seconds by default. sai_task_wait holds for at most 55 seconds, so the task tools work without changing it. A wait that returns while the task is still running can be called again with the returned cursor.
  • The Codex app shows the task view in the conversation but keeps it offline, so the screen can't stream there. Open the watch_url link instead; see Watch Sai work.
  • sai_task_wait retries a gateway 502, 503 or 504 on its own before reporting an error.
© 2026 Simular Inc. All rights reserved.