Codex CLI 0.172.0 Starts MCP Lazily

0.172.0 puts the serious Codex CLI changes around MCP startup and connected app approvals: optional stdio MCP servers with cached tool lists now start on their first tool call by default, and individual connected app tools can now have an approval reviewer in config.toml. For anyone following Codex CLI GitHub releases, this is the release where OpenAI tightens terminal workflow state, remote session continuity, and tool boundaries in one pass.
| Question | Answer |
|---|---|
| Who must act | Users who manage optional stdio MCP servers or connected app tool approvals should review the new defaults and config.toml settings. |
| What changes for them | Optional stdio MCP servers with cached tool lists now start on their first tool call by default. |
| Who can skip | Users who do not use MCP, connected app tools, remote sessions, or codex exec resume have less to check in this release. |
Read the release as a state-handling update
The visible convenience work is useful. Thread links from search results and transcripts can open saved conversations and nested agents in the terminal. Slash commands also gained argument completion, so /mcp lo can complete to /mcp login.
The more important part is state preservation. codex exec resume now restores saved sandbox permissions, the working directory, and workspace roots unless the user overrides them. Remote sessions also preserve working directories, workspace roots, and writable paths when the client and server run on different operating systems.
That matters because Codex workflows often cross local terminals and remote app servers. A resume that forgets its writable roots causes real trouble. It changes what the agent can touch.
Rolling this out in your team?
We train engineering teams on their own codebase in two days. Codex setup, shared rules and review included.
Let MCP start on the first real call
The changed default is narrow and practical. Optional stdio MCP servers with cached tool lists now start on the first tool call by default.
That means Codex can know about tools without eagerly launching every optional stdio server at the start of the session. It should make terminal sessions less noisy when a repo has integrations that are available but not always needed.
The limit is in the wording. This applies to optional stdio MCP servers with cached tool lists. A server that must be live to discover tools or refresh auth may need different handling.
Put review at the tool boundary
The release also lets a connected app tool have its own approval reviewer in config.toml. OpenAI does not publish a full example in the changelog entry, so the safe reading is simple: check the current Codex CLI docs before editing syntax, and treat the release note as the capability announcement.
This is a good place to connect the feature to Review in our methodology. The useful boundary is the tool call, because that is where a Codex agent reaches outside the transcript and into a system with data or side effects.
A GitHub-related connected app tool is a good example of the shape, without inventing a repo-specific config. A read-only search tool and a tool that changes issues or pull requests should not need the same approval path.
Try it in one existing repo
Use one repo that already has Codex CLI history or MCP configuration. The goal is to see whether the new release preserves context and waits to start optional integrations until they are needed.
- Upgrade the CLI with the command from the release note:
npm install -g @openai/codex@0.172.0. - Start in a repo with an optional stdio MCP server, then run a normal Codex task that does not need that server before asking for a tool call that does.
- Resume a saved
codex execsession and check that sandbox permissions and the working directory match the prior run unless you explicitly override them.
If your path into the release is Codex cli github, use the official repository for issue context and the changelog for product behavior. GitHub is good for seeing the merged work. The changelog is the source to trust for what shipped.
Compare the changes before changing config
| Change in 0.172.0 | What to inspect first | Honest limit |
|---|---|---|
| Optional stdio MCP servers start on first tool call by default | Check optional servers that rely on cached tool lists. | Servers with dynamic discovery or auth refresh may need closer review. |
| Per-tool approval reviewers can be set for connected app tools | Review tools with write access or sensitive data access. | The changelog names the capability, but the exact config.toml shape belongs in the docs. |
codex exec resume restores saved session state |
Resume a real saved session and compare paths, roots, and sandbox permissions. | Overrides still win when explicitly set. |
| Remote sessions preserve paths across different operating systems | Test one client-server pair that crosses OS boundaries. | This does not prove every path mapping in a custom environment is correct. |
The terminal improvements are still worth using. Thread links now open saved conversations and nested agents from search results and transcripts, and Shift+Up or Shift+Down jumps between task groups in the agent command center. If you adopted the TUI changes in Codex CLI 0.171.0 Makes TUI Default, this release makes that terminal surface easier to navigate.
Keep the error path visible
Codex now reports provider errors as soon as they arrive in a response stream and identifies which API spend limit was reached. That is a small line in the changelog, but it removes a common ambiguity during long-running agent work.
There are also transcript-order fixes. Cloud replies that finish after history loads now update in place, and interrupting a parent turn preserves queued replies from child agents for the next turn.
The practical effect is less replaying and less guessing. When a run fails because of a provider limit, the operator should see the limit scope instead of treating the failure like a model or prompt problem.
Further reading
Upgrade one repo first
Upgrade one active repo to 0.172.0, then verify lazy MCP startup and codex exec resume before changing connected app approval settings. Keep notes with your existing CLI workflows so the next repo upgrade is mechanical.
Train your team on Codex
Two days on your team's own repository, onsite or remote, with a written proposal before you commit.
Book a callPrefer to measure first? Take the free team check.