Coding agents
Codex
Add the Sai MCP server to OpenAI Codex.
View as MarkdownCodex reads MCP servers from ~/.codex/config.toml. The same npx command that Claude Code uses works here.
Install
bash
codex mcp add sai --env SAI_API_KEY=sapi_... -- npx -y @simular-ai/sai-mcpOr edit the config by hand:
toml
[mcp_servers.sai]
command = "npx"
args = ["-y", "@simular-ai/sai-mcp"]
# sai_task_wait holds for up to 110 s; Codex's default tool timeout is 60 s.
tool_timeout_sec = 120
[mcp_servers.sai.env]
SAI_API_KEY = "sapi_..."Restart Codex after editing the file.
Verify
bash
codex mcp listThen ask:
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.
Gotchas
- Codex has no equivalent of Claude Code channels, so there is no push mode. Polling through
sai_task_waitis the only path. - Keep the key out of the repository.
~/.codex/config.tomlis per user; a project-level.codex/config.tomlis committed by default in many repositories. - Codex applies its own timeout to tool calls, 60 seconds by default.
sai_task_waitcan hold for up to 110 seconds, so settool_timeout_sec = 120as above. A wait that returns early can be called again with the returnedcursor. - The Codex app shows the task view in the conversation but keeps it offline, so the screen can't stream there. Open the
watch_urllink instead; see Watch Sai work. sai_task_waitretries a gateway502,503or504on its own before reporting an error.