gloss

Codex Now Lists MCP Tools From Servers It Hasn't Started

Codex 0.172.0 starts stdio MCP servers on first use and shows new threads a tool list it keeps in memory for 30 minutes.

A lit shop window at dusk displays drills, sanders, a circular saw and hand tools on a pegboard, beside a dark blue roller shutter pulled fully down.
  • Codex 0.172.0 starts a stdio MCP server on its first tool call when it already has that server's tool list. The list sits in memory for 30 minutes per Codex process. In my tests, 37 of 37 new threads with a warm list opened without a server process, and the model listed the server's tools from the cache every time I asked.
  • Nothing checks that list against the server. After my test server gained a tool, 12 of 12 new threads said they had no tool for the job, and the server was never started to ask. A server that crashes at start stays listed, and the error arrives at the first tool call, in the middle of a task.
  • codex exec starts a new process every run, so it isn't affected. For a server whose tools change while Codex is open, set required = true on it or turn off features.mcp_lazy_stdio_startup.

Codex 0.172.0 came out on 24 November. One line in its release notes reads: "Optional stdio MCP servers with cached tool lists now start on their first tool call by default." The MCP docs add that without a cached tool list, Codex starts the server when the thread starts.

Neither says where the cache lives, how long it lasts, or what happens when it's out of date. I read the source, then tested it.

What the source says

The feature is called mcp_lazy_stdio_startup. It was marked under development and off until this release. Now it's stable and on.

The cache is in codex-mcp/src/tool_catalog_cache.rs, and the comment above it calls it process-scoped. It holds 32 entries in memory, each good for 30 minutes after the server last listed its tools. Nothing goes to disk. An entry is keyed on the server's name, command, arguments and environment, plus the working directory.

By that reading, codex exec gets nothing from it, since every run is a new process with an empty cache. Each of the 22 Codex processes in my test started the server for its first thread, although the process before it had listed the same tools minutes earlier. The change matters where one Codex process serves many threads, such as the IDE extension.

The test

I wrote a stdio MCP server in Python, about 190 lines, with two tools: lookup_order and list_refunds. It logs every start and every request. A scenario file decides what it serves the next time it starts.

A second script drove codex app-server over stdio. The docs describe that as the interface behind rich clients such as the Codex VS Code extension, and it let me open several threads inside one Codex process. Codex ran with a fresh CODEX_HOME, an API key, and GPT-6.2 Sol at low reasoning effort. That made 22 app-server processes, 79 threads and 109 turns.

A warm thread doesn't start the server

Take one run. The first thread started the server 0.26 seconds in and reported it as starting, then ready. The second thread opened at 6.9 seconds with no status event and no server process.

I asked the second thread to list its tools from the server, and it named both. Then I asked it to look up an order. The server process appeared at 20.7 seconds, as the model made its first call.

All 37 threads that had a warm list opened that way. With the feature off, 8 of 8 such threads started the server as they opened.

The gain is in processes, not speed. Each thread gets its own server process, so six threads meant six processes with the feature off and three with it on. A first turn didn't wait for a slow server in either mode. When the server took three seconds to start, the first answer still came back in about 2.4 seconds.

Nothing checks the cached list

Between threads I changed what the server would serve on its next start, the way an update does.

What changed on the server What new threads did
It gained a tool, cancel_order Asked to cancel an order, 12 of 12 answered that they had no tool for it, including threads opened 10, 20 and 29 minutes later. The server wasn't started in any of them
lookup_order became get_order The model listed the old names. Its first call failed inside Codex with "MCP tool orders/lookup_order is not available to the model" and never reached the server (3 of 3)
It exits with an error at start The thread reported nothing and the model listed both tools. The first call failed with "Could not start MCP server orders" (3 of 3)

One call to any tool on the server repairs a thread. Codex starts the server, reads the real list and swaps it in. After the failed lookup_order call, the same thread listed get_order, cancel_order and a new required argument on list_refunds, and passed that argument on its next call.

The next new thread had the new list too. In the runs with the added tool, two of three threads found cancel_order after a successful call to an old tool. The third said it had no such tool without searching again.

The list does expire on schedule. In two runs, a thread opened 31.5 minutes after the server last listed its tools started the server as it opened. In the run where I asked for a cancellation, that thread found cancel_order and used it.

The crash case doesn't repair itself. After the failed call, that thread had no tools from the server. The next new thread listed both again from the cache, 3 of 3.

With the feature off, every new thread saw cancel_order and used it. A crashing server produced a failed status with the error text as each thread opened, and the model said it had no such tools.

The model did nothing wrong in any of this. It reported what its list said, and the list was out of date.

What limits it

The cache is per folder. A thread in a second project folder started the server at once and got its own list. A thread back in the first folder used the cached one.

required = true on the server makes every thread start it (2 of 2). Adding startup_readiness = "catalog" defers it again, as the docs say.

A server can also opt out. If the capabilities in its initialize response include "experimental": {"codex/tool-catalog-cache": {"cacheable": false}}, Codex doesn't cache its list. Once my server sent that, it was started with every thread (2 of 2). I found this in the source, not in the docs.

The cache also drops each tool's annotations, the hints Codex uses when it decides on approval, so those always come from the running server. In one run Codex started the server first and only then refused the call for lack of approval.

MCP's notification for a changed tool list doesn't cover this. Codex's support for it, mcp_tool_list_changed, is still marked under development and off. A server that isn't running can't send one anyway.

What I'd change

If you're developing an MCP server, or yours takes its tools from a login state, a feature flag or npx -y some-server@latest, put required = true on it. Or set features.mcp_lazy_stdio_startup = false and accept the extra processes.

If you publish a server whose tool list changes, send the opt-out capability.

And when Codex says a tool you just added doesn't exist, check Codex before the server. Ask it to call any other tool on that server, or restart Codex. The server may never have been asked.

I tested through codex app-server only, on macOS, with one model and an API key. I didn't run the desktop app, the IDE extension or the terminal UI, and I didn't test HTTP servers or subagents. The source says subagents defer every server that has a cached list, HTTP ones included, whether or not the feature is on.

The runs sent 4.9 million input tokens over 211 model requests. Nearly all of that was Codex's own 23,000-token prompt going into or coming out of the prompt cache. At list prices that is between $5 and $10, depending on which cache-write rate applied.