Codex CLI starts optional MCP server on first call if its tools are cached
OpenAI’s Codex CLI now starts an optional local MCP server by default only on the first tool call, provided the server’s tool list is cached. When resuming an automated run, Codex also restores saved sandbox permissions.
OpenAI released version 0.172.0 of Codex CLI on GitHub on 24 November 2026. Codex CLI is a coding agent that reads and edits code and runs commands in the user’s terminal.
An MCP server gives Codex tools from other systems. A stdio server is a local process that Codex starts with a command. According to the changelog, an optional stdio server now starts by default only when one of its tools is first called, provided that the server’s tool list is already cached.
So the change does not affect a server whose tools have not yet been saved, or a required server. Codex’s MCP documentation says startup fails if a server marked with required = true is not ready. Nor does a cached list replace the connection: a tool call always needs a live connection to the server, the documentation says. If a server must be available as soon as a session starts, it is therefore worth marking it as required. The changelog does not say how much faster sessions start.
In the config.toml settings file, users can now choose a separate reviewer for each tool in a connected app. The reviewer decides whether to approve the tool’s request.
The release also fixes how automated runs resume. Unless the user explicitly sets new values, the codex exec resume command now restores saved sandbox permissions, the working directory and workspace roots.
Other changes include Tab completion for slash-command arguments, and remote sessions keeping their directories when the client and server run on different operating systems. Code Mode now always uses gRPC connections, so the code_mode_host_grpc setting is deprecated.
On macOS and Linux, users can install Codex CLI with OpenAI’s installer script. The documentation also lists installation options for Windows, npm and Homebrew. Users sign in with a ChatGPT account or another available method. The codex update command updates the program if the installed release supports self-updating.
Read more: How an agent works · Agent map