MCP needs a greater timeout for startup (Windows)
What version of Codex is running?
v0.5.0
Which model were you using?
gpt-5
What platform is your computer?
Windows_X64
What steps can reproduce the bug?
Before I had sent a post https://github.com/openai/codex/issues/2893 use MCP in Windows environment, for example, will get an error "MCP client for context7 failed to start: "request timed out", all kinds of tinkering didn't solve the problem. Later, I modified two files in the source code and then repackaged codex.exe to solve it:
codex-rs\core\src\mcp_connection_manager.rs
codex-rs\mcp-client\src\mcp_client.rs
<img width="1191" height="527" alt="Image" src="https://github.com/user-attachments/assets/1480ece7-dbf3-40d0-b570-02e1462235fe" />
<img width="1204" height="529" alt="Image" src="https://github.com/user-attachments/assets/550b3cc8-1882-4563-84f8-6bc1572442bf" />
<img width="1203" height="821" alt="Image" src="https://github.com/user-attachments/assets/6186936e-1cb8-4f02-95e6-6ea8ea2c71d4" />
[mcp_servers.context7]
command = "F:\\software\\nodejsold\\npx.cmd"
args = ["-y", "@upstash/context7-mcp", "--api-key", "xxxxxxxxxxxxxxxxxxxxxxxxxx"]
=====================================The following is the effect after the solution:
<img width="736" height="680" alt="Image" src="https://github.com/user-attachments/assets/ca246451-6e96-4b38-b8c5-bc6abe3be34c" />
<img width="747" height="707" alt="Image" src="https://github.com/user-attachments/assets/f8d59783-2f38-45ad-b62a-8eb11cfdef74" />
What is the expected behavior?
_No response_
What do you see instead?
_No response_
Additional information
_No response_
7 Comments
Same here for Playwright
https://github.com/microsoft/playwright-mcp/issues/967
@SphaeroX I'll give you two modified files. You can package them into exe files yourself to replace the cod in "C:\Users\username\\.vscode\extensions\openai.chatgpt-0.5.0-win32-x64\bin\windows-x86_64" ex.exe will do
codex-rs\core\src\mcp_connection_manager.rs
codex-rs\mcp-client\src\mcp_client.rs
Use this command to package as an exe file:
cd codex-rs; cargo build --release
and get it :"\codex\codex-rs\target\release\codex.exe"
conversation_manager.zip
mcp_client.zip
macOS same error
Same issue here for the Serena MCP Server in the VSCode Terminal. Very frustrating
So great that you found this!
I am trying to follow these steps but there are several mismatches:
Now, What is codex-rs? Is it a tool? OR Can I just rename downloaded .rs files to .exe? would it work?
[Let me know if I am missing something here]
Attached the screenshot as well:
<img width="775" height="231" alt="Image" src="https://github.com/user-attachments/assets/1ac32809-4651-45fa-bcc0-eccae7cf8e2e" />
Is it solved in latest release?
https://github.com/openai/codex/releases/tag/rust-v0.31.0 now supports
startup_timeout_ms, so please use that!