Repository navigation
Description
What version of Codex CLI is running?
codex-cli 0.161.0
What subscription do you have?
plus
Which model were you using?
No response
What platform is your computer?
Windows 11
What terminal emulator and version are you using (if applicable)?
PowerShell
Codex doctor report
What issue are you seeing?
On Windows, a configured stdio MCP server fails to initialize when Codex is started normally:
codex
The MCP server appears as:
unreal-engine: failed (0 tools)
However, starting Codex with an explicit log_dir CLI override makes the same MCP server connect successfully:
codex -c 'log_dir="D:/development/projects/ue5/StartProject/.codex-log"'
The interesting part is that adding the exact same log_dir setting to ~/.codex/config.toml does not fix the issue:
log_dir = "D:/development/projects/ue5/StartProject/.codex-log"
So the behavior appears to depend on passing a configuration override via -c, rather than on log_dir itself.
When Codex is started with the -c log_dir=... workaround, the MCP connection is fully functional, not just reported as connected. I can successfully execute MCP operations that modify the Unreal Editor scene.
Environment
OS: Windows 11
Codex CLI: 0.161.0
MCP transport: stdio
MCP server: unreal-engine-mcp-server@beta
MCP server runtime: Node.js / npx
MCP github: https://github.com/ChiR24/Unreal_mcp
What steps can reproduce the bug?
- Start Codex normally:
codex
- Check /mcp.
Result:
unreal-engine: failed (0 tools)
-
Exit Codex.
-
Start it with an explicit CLI config override:
codex -c 'log_dir="D:/development/projects/ue5/StartProject/.codex-log"'
- Check /mcp again.
Result: the MCP server connects successfully and its tools work.
What is the expected behavior?
No response
Additional information
This looks like it may be related to Codex startup/config initialization on Windows rather than to the MCP server itself, because:
- the MCP server starts successfully outside Codex;
- Codex reads the MCP configuration correctly;
- the server uses stderr for diagnostic output;
- the connection works reliably when any explicit -c log_dir=... override is supplied;
- putting the same log_dir value in config.toml does not have the same effect.
Activity
naelonambul commentedon Oct 20, 2026
Sharing a related case on Windows in case it helps:
Environment:
0.163.0(PyCharm / TUI)nvmWhat happened:
codex mcp listshowed the server as enabled, but in the TUI it initially showedfailed (0 tools).nvmNode installation directory was missing from the MCP processPATH, sonode/npxcould not be resolved.PATH, the status changed fromfailed (0 tools)toconnected (32 tools).About the
-c log_dir=...workaround:While I didn't test it myself, my coworkers tested the
-c log_dir=...workaround and confirmed that changing the log directory name on each launch (e.g., appending2,3, etc.) makes the tools work again.