The solution for encountering the Error "Error creating local task: Error: Timeout" when using "startup_timeout_ms" under windows
Resolved 💬 7 comments Opened Sep 9, 2025 by sfz009900 Closed Sep 9, 2025
What version of the VS Code extension are you using?
v0.5.6
Which IDE are you using?
VS Code
What platform is your computer?
Microsoft Windows NT 10.0.19045.0 x64
What steps can reproduce the bug?
This is the situation where an error was reported before:
https://github.com/openai/codex/issues/3348
Now I have tried it myself and obtained a solution that can currently run MCP successfully:
[mcp_servers.context7]
command = "F:\\software\\nodejsold\\npx.cmd"
args = ["-y", "@upstash/context7-mcp", "--api-key", "xxxxxxxxxxxxxxxxxx"]
startup_timeout_ms = 20_000
env = { APPDATA="C:\\Users\\testuser000\\AppData\\Roaming", LOCALAPPDATA="C:\\Users\\testuser000\\AppData\\Local", HOME="C:\\Users\\testuser000", SystemRoot="C:\\Windows", ComSpec="C:\\Windows\\System32\\cmd.exe", NPM_CONFIG_REGISTRY="https://registry.npmmirror.com" }
it's ok :)
<img width="654" height="551" alt="Image" src="https://github.com/user-attachments/assets/49fe39b0-159a-4bb0-869d-2c2b76a58a54" />
What is the expected behavior?
_No response_
What do you see instead?
_No response_
Additional information
_No response_
Showing cached comments. Read the full discussion on GitHub ↗
6 Comments
Also working with
Narrowed it down to just adding this:
env = { SystemRoot="C:\\Windows" }fixes it for me.
Great work man, thanks alot.
For those looking for a complete example of config.toml working with Windows 11 Pro 24H2:
Thanks @micahdlamb @mizuikk
Thanks a lot.... I struggled for 3 Hours, and you helped me!
my solution on windows with codex on vscode is: