Codex MCP tool timeout: tool_timeout_sec and slow jobs
Codex gives each MCP tool call 60 seconds by default. Raise tool_timeout_sec per server in config.toml, or keep slow media jobs inside the limit.

Codex allows an MCP tool call 60 seconds by default. To give a server's tools more time, set tool_timeout_sec on the server's [mcp_servers.<name>] table in config.toml. Server startup has a separate limit, startup_timeout_sec, which defaults to 10 seconds.
The Codex settings come from OpenAI's Codex MCP page and configuration reference, read on 2026-09-28. The slow-job example uses Sume's hosted MCP server and its Jobs and results docs.
Which Codex settings control MCP timeouts?
All of them live in ~/.codex/config.toml, or in a project's .codex/config.toml for trusted projects. The ChatGPT desktop app, the Codex CLI, and the IDE extension share this configuration.
| Setting | Default | What it does |
|---|---|---|
tool_timeout_sec | 60 seconds | Time the server has to run one tool call |
startup_timeout_sec | 10 seconds | Time the server has to start |
mcp_optional_startup_grace_ms (top level) | 1000 ms | Shared wait for optional servers while Codex builds its tool list; 0 waits for each server's startup timeout |
How do I raise tool_timeout_sec?
Add the key to the server's table. For Sume's hosted server, which the MCP quickstart connects as a streamable HTTP server:
- Then run
codex mcp login sumeto finish the OAuth sign-in. - The value is per server, so a slow server can get more time without changing the others.
startup_timeout_msis an alias forstartup_timeout_secin milliseconds, andrequired = truemakes startup fail if the server can't initialize.
[mcp_servers.sume]
url = "https://mcp.sume.com/mcp"
tool_timeout_sec = 120
startup_timeout_sec = 20Why does a media generation call hit the timeout?
A tool that holds the call open until a video finishes rendering can need more than a minute. A higher limit only helps so far: Sume's Jobs and results page notes that every edge eventually closes a request held open with nothing transferring, and the caller then gets no tool result while the job keeps running and billing.
Sume's generation tools avoid this by returning quickly. The video API is asynchronous: a submit answers with a job id right away (Video API). In current code, generate_image over MCP submits in async mode too. The agent then calls jobs_status or jobs_wait, and reads jobs_result when the job is done (MCP tools and gates).
Does a longer timeout make jobs_wait wait longer?
No. On Sume's remote MCP, one jobs_wait call holds at most 55 seconds, with a default of 50, so it already fits inside Codex's 60-second default and a higher tool_timeout_sec doesn't stretch it. For a longer render the agent calls jobs_wait again on the same ids and never resubmits the paid create; MCP tool call timeouts on long video jobs covers the slice outcomes and batch waits.
The risk runs the other way. Codex's own sample config sets tool_timeout_sec = 45, and a wait slice can run to 55 seconds. If you lower the limit below 55, keep a wait's timeout_seconds under it, or Codex gives up on a wait the server is still holding.
What should I do after Codex times out on a tool?
Treat the timeout as a lost response, not a failed job: Sume's docs say not to resubmit the original paid request just because a local process timed out. If the timeout hit a wait, the job id is already in the conversation, so have the agent call jobs_status on it. If there is no id, list recent jobs with jobs_list before submitting anything again. Can Codex make videos? covers adding a video tool to Codex in the first place.
Sources
Related posts
More in Integrations
- Continue MCP server: add Sume in .continue/mcpServers
Add Sume's hosted MCP server to Continue with a YAML block in .continue/mcpServers: type streamable-http, the URL, and a key from a secret.
- Copilot CLI MCP server: add Sume with copilot mcp add
Add a remote MCP server to GitHub Copilot CLI with copilot mcp add: Sume's hosted MCP, a key header or OAuth, and a timeout above 55 seconds.
- CrewAI MCP server: connect an agent to Sume's tools
Give a CrewAI agent Sume's hosted MCP tools with MCPServerHTTP in the mcps field: a Bearer key header, a tool filter, and short jobs_wait slices.
- Crontab curl: call an API daily and escape the % sign
A crontab line runs curl with /bin/sh, and a bare % becomes a newline. Escape it as \%, use full paths, log the output, and key the request by date.
Written by Sume