The Codex Changelog
All Episodes
Codex 0.170.0: Scoping Same-Named MCP Servers and OAuth Fixes

Codex 0.170.0: Scoping Same-Named MCP Servers and OAuth Fixes

0:00|0:00

Codex CLI 0.170.0 introduces experimental support for keeping identically named MCP servers separate across different environments to prevent tooling collisions. This episode covers how to safely verify your environment scopes and highlights fixes for MCP OAuth credential races during login, logout, and cancellation.


Chapter 1

Same Name, Different Environment

James Turner

Quick one before we start. If you ran Codex against both a local database server and a staging one, and you named them the same thing, did you ever stop and wonder which one the agent was actually talking to? Yesterday's topic was auth refresh headers in 0.170.0. Today it's the other half of that release, the MCP work. And thanks to Jellypod AI for sponsoring this episode.

James Turner

So, here's what changed. Codex CLI 0.170.0 shipped on November 18th. You get it with npm install dash g, at openai slash codex at 0.170.0. Or the standalone installer, curl from chatgpt dot com slash codex slash install dot sh. In the release notes, under New Features, there's a line: experimental support for using identically named MCP servers across environments. That's pull request 60905, titled Keep same-named MCP servers separate across environments, from sayan-oai.

James Turner

Why does that matter? Think about a setup where your repo config defines an MCP server called, say, database, pointing at local dev. Then a team or remote environment also defines one called database, pointing at staging. Same logical name, different backends. Before this, same names meant collisions. One could shadow the other, and the risk is the agent calls a tool and it lands on the wrong target. A staging migration that hits local dev is annoying. The reverse is worse.

James Turner

Now, one thing I want to keep straight. The release note says experimental, and that's all it says. I'm not going to invent a config schema for you. What the note and the pull request title tell us is the behavior: same-named servers are kept separate per environment instead of colliding. The exact syntax could change before it stabilizes.

James Turner

So how would you use it? First, upgrade in one repo where Codex already runs. Second, set up your environments so the identical server names sit in separate environment scopes, rather than renaming things to work around the collision. Check the current Codex docs for the exact config shape, because it's experimental. Third, and this is the step that matters, look at what the session actually exposes. Open the tool list in your session or subagent, and confirm the tools are bound to the environment you meant. Then read the transcript. When the agent calls a tool, check which endpoint it hit, before you accept the diff.

Chapter 2

OAuth Races and Small Fixes

James Turner

Now the part of the MCP work that's less flashy but probably bites more people. Pull requests 60849 and 60981 fix MCP OAuth credential races during cancellation, login, and logout. The first protects OAuth persistence from stale credential writes. The second makes reactive token refreshes cancellation-safe.

James Turner

Picture the failure. You start an OAuth handshake against a remote MCP gateway, you cancel halfway, or a refresh is in flight when you log out. A late write from the old attempt lands after the new state, and you've got stale credentials saved. That's the class of problem these patches address. To test it, re-run an MCP authorization flow that exercises cancel, login, and logout, in that messy order, and see whether auth sticks cleanly.

James Turner

A few smaller things in the same release. Oversized WebSocket requests now fall back to HTTP immediately, without pointless retries, and they honor advertised message size limits. Child threads and permission updates no longer lose existing sandbox restrictions, which matters if you lean on subagents. Idle Cloud conversations reconnect after transient stream loss, and active recovery turns are preserved. And on Windows, atomic file replacement and permission preservation during repeated sandbox setup got fixed.

James Turner

The takeaway. Upgrade in one repo, keep the experimental label in mind, and verify routing yourself. Don't trust a shared server name to mean what you think it means. Check the transcript. That's the changelog for today.