Codex extension in vscode: MCP server (Context7) fails with “request timed out”
What version of Codex is running?
0.4.3
Which model were you using?
gpt 5
What platform is your computer?
Microsoft Windows NT 10.0.26100.0 x64
What steps can reproduce the bug?
I tried these variations in my config.toml:
[mcp_servers.context7]
args = ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
command = "npx"
=> 🖐 MCP client for context7 failed to start: program not found
[mcp_servers.context7]
command = "C:\\Program Files\\nodejs\\npx.cmd"
args = ["-y","@upstash/context7-mcp@latest","--transport","stdio"]
=> 🖐 MCP client for context7 failed to start: request timed out
So i change:
Install Context7 globally and link to it directly:
npm i -g @upstash/context7-mcp
Config:
[mcp_servers.context7]
command = "C:\\Program Files\\nodejs\\node.exe"
args = ["C:\\Users\\Name\\AppData\\Roaming\\npm\\node_modules\\@upstash\\context7-mcp\\dist\\index.js","--transport","st
=> i work but unfortunately, I keep getting errors like this :(
"result": {
"Ok": {
"content": [
{
"text": "Error searching libraries: TypeError: fetch failed",
"type": "text"
}
]
}
What is the expected behavior?
_No response_
What do you see instead?
_No response_
Additional information
_No response_
17 Comments
Almost all mcps servers encounter this problem in windows, I believe it's related to a winsocket error.
@ahSOLO This isn't the main issue. The core problem is that codex's MCP timeout defaults to 10 seconds. Even when we manually execute "npx -y @upstash/context7-mcp" in the terminal, it exceeds 10 seconds.
same here:
Yeah I understand the timeout is too low, but even if you find a way around that (local installation, proxy server), you'll still get that error on a native Windows environment due to the winsocket error. For me I had to use WSL to escape it.
Same problem here.
It was working ok in my 2 computers, but after a few days stopped working in both.
没用的,我设置超时为600秒,照样超时
@luodaoyi
Check out my solution! 😉
https://github.com/openai/codex/issues/3385
It work‘s ! Thanks ,
I tried your solution and it worked, thanks.
Thanks @sfz009900, TLDR; just add
startup_timeout_ms = XXXXXfor each mcpbecause some MCP installations take longer than the codex default timeout.
不是timeout的问题是环境变量的问题!环境变量设置后期才可以正常启动mcp,否则timeout不管改多少都会超时
I'm using mac and same things happen to me as well....
For Windows users, this works for me with Codex 0.38.0:
@wbdb env = { SystemRoot="C:\\Windows" } ,This method is effective, very good
After testing, I found the following three feasible solutions:
npxinstead of path will result in an error stating that the program not found):Among them, the env configuration is required for the 2nd and 3rd plans. If you still receive a "request timed out" message, add the following line:
startup_timeout_ms = 20_000to resolve the issue.The direct cause of this issue is the environment variable whitelist.
codex-rs/mcp-client/src/mcp_client.rs:435
https://github.com/openai/codex/issues/4180
I think this issue is now addressed by the changes to the environment variable whitelist. If you see any further problems related to this, please let us know.