You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Codex CLI on Windows 11: MCP server (Context7) fails with “request timed out” #2555
I started to use Docker MCP Toolkit (you can find there Context7 MCP, Firecrawl, Playwrith and more). And it works for Codex CLI (and Codex VSCode extension).
I started to use Docker MCP Toolkit (you can find there Context7 MCP, Firecrawl, Playwrith and more). And it works for Codex CLI (and Codex VSCode extension).
It didn't work for me. Only the per-server entries below worked. Posting in case it helps others.
After a lot of failures trying to spawn MCP servers with npx on Windows, I used ChatGPT to iterate on options and landed on a simple, reliable fix:
Environment
Windows 11
PowerShell 7.x
Docker Desktop
Codex CLI (latest at time of writing)
Symptoms
npx @playwright/mcp@latest would repeatedly “request timed out” when launched by Codex, even though it worked in MCP Inspector.
What worked (Docker over STDIO)
Pre-pull (optional but speeds up first run):
docker pull mcp/playwright
docker pull mcp/fetch
To be fair, it should be noted that they do state that it is preferable to use it with WSL. However, now that the VS Code extension has been released, it is time for this to be implemented for Windows as well.
As mentioned, it runs very effectively with WSL, especially since it is already inclined to try Linux commands.
I also wanted to follow up if anyone else finds this thread. Thanks to the guidance of @VladimirLevadnij I was also able to get the "local" and "remote" mcp's running. Just use one or the other. For some reason, the node module got uninstalled. So if anyone else is having this issue, try this solution. First install the module in your project, then add the code to your config file, lastly start codex, wait a few seconds, and verify with /mcp
Local Version -
Install in project
npm install -g @upstash/context7-mcp
@tekn0x I'm glad to hear that everything worked out for you. I hope that everything else in your life is fine, except for this problem. Everything works out, everything is moving towards a bright future, you are not being abducted by aliens👽, there is no evil dog living next to you 🐕 and so on 😁
Reacted by Jeremy Castro, Eduardo Rodriguez, moritalous, devops-ezedy, Omar Wehbeh, Daniel Trindade, Alva, Woody, Phạm Tiến Hải, Front-end Developer and 3 more
Activity
gurumnyang commentedon Aug 21, 2025
same issues
wbdb commentedon Aug 21, 2025
Temporary workaround:
Install Context7 globally and link to it directly:
npm i -g @upstash/context7-mcpConfig:
gurumnyang commentedon Aug 21, 2025
it works! you are my hero
wbdb commentedon Aug 21, 2025
@gurumnyang
But unfortunately, I keep getting errors like this :(
You too?
gurumnyang commentedon Aug 21, 2025
Added to the /mcp list, but when I tested it, I got the same error...
wbdb commentedon Aug 22, 2025
I now use it via Windows WSL. It works flawlessly there.
WSL
Open WSL:
wslEnable WSL 2:
wsl.exe --set-default-version 2Install Ubuntu 24.04 LTS:
wsl --install -d Ubuntu-24.04Set Ubuntu as default (for
wslstart):wsl --set-default Ubuntu-24.04List installed WSL distros:
wsl -l -vSwitch to a specific WSL distro:
wsl -d Ubuntu-24.04Execute a specific command directly:
wsl -d Ubuntu-24.04 ls -laExit WSL session:
exitShut down all WSL sessions:
wsl --shutdownTerminate a specific WSL session:
wsl --terminate Ubuntu-24.04Codex & Node.js
Check correct Linux version:
uname -aInstall updates:
sudo apt update && sudo apt upgrade -yInstall essential packages:
sudo apt install -y curl git build-essential unzipDownload and install fnm:
curl -o- https://fnm.vercel.app/install | bashDownload and install Node.js:
fnm install 22Reload shell:
source ~/.bashrcVerify Node.js version:
node -v(should print “v22.18.0”)Verify npm version:
npm -v(should print “10.9.3”)Update npm:
npm install -g npm@latestShow npm version:
npm --version(e.g. 11.5.2)Install Codex CLI:
npm install -g @openai/codexCheck Codex version:
codex --versionMCP Context 7 Setup
Create config directory and file, then edit:
mkdir -p ~/.codex && touch ~/.codex/config.toml && nano ~/.codex/config.tomlAdd the following:
evgenyop commentedon Aug 25, 2025
After spending (wasting) several hours troubleshooting this issue, I found a workaround:
`
[mcp_servers.learn_mcp]
command = 'node'
args = [
'C:/Users/username/AppData/Roaming/npm/node_modules/mcp-remote/dist/proxy.js',
'https://learn.microsoft.com/api/mcp'
]
env = { APPDATA = 'C:\Users\username\AppData\Roaming', LOCALAPPDATA = 'C:\Users\username\AppData\Local', SystemRoot = 'C:\WINDOWS', COMSPEC = 'C:\WINDOWS\system32\cmd.exe' }
`
edulml98 commentedon Aug 30, 2025
Hello, are there another install options?
sting8k commentedon Aug 30, 2025
Same issue here. The following is a quick way to fix it:
I was able to get this working with the server-memory MCP as well.
Update 1/9: I’m now using MCP-Router as the central gateway for all other MCP servers.
Then I only need to push this into config.toml:
Xopoko commentedon Aug 31, 2025
I started to use Docker MCP Toolkit (you can find there Context7 MCP, Firecrawl, Playwrith and more). And it works for Codex CLI (and Codex VSCode extension).
Details
My config:
eburakars commentedon Aug 31, 2025
Is there anyone who can resolve the error “Error searching libraries: TypeError: fetch failed” using Windows 11 cmd?
hbiaou commentedon Sep 1, 2025
It didn't work for me. Only the per-server entries below worked. Posting in case it helps others.
After a lot of failures trying to spawn MCP servers with
npxon Windows, I used ChatGPT to iterate on options and landed on a simple, reliable fix:Environment
Symptoms
npx @playwright/mcp@latestwould repeatedly “request timed out” when launched by Codex, even though it worked in MCP Inspector.What worked (Docker over STDIO)
Pre-pull (optional but speeds up first run):
docker pull mcp/playwright
docker pull mcp/fetch
Codex config: %USERPROFILE%.codex\config.toml
[mcp_servers.fetch]
command = "docker"
args = ["run","--rm","-i","--init","--security-opt","no-new-privileges","mcp/fetch"]
[mcp_servers.fetch.env]
PYTHONIOENCODING = "utf-8"
PYTHONUNBUFFERED = "1" # avoids rare Python stdio stalls on Windows
[mcp_servers.playwright]
command = "docker"
args = ["run","--rm","-i","--init","--security-opt","no-new-privileges","mcp/playwright"]
Notes
Keep -i (STDIO attached). Don’t use -d.
Sanity checks
These should return help immediately:
docker run --rm -i mcp/playwright --help
docker run --rm -i mcp/fetch --help
wbdb commentedon Sep 2, 2025
To be fair, it should be noted that they do state that it is preferable to use it with WSL. However, now that the VS Code extension has been released, it is time for this to be implemented for Windows as well.
As mentioned, it runs very effectively with WSL, especially since it is already inclined to try Linux commands.
20 remaining items
tekn0x commentedon Sep 16, 2025
I also wanted to follow up if anyone else finds this thread. Thanks to the guidance of @VladimirLevadnij I was also able to get the "local" and "remote" mcp's running. Just use one or the other. For some reason, the node module got uninstalled. So if anyone else is having this issue, try this solution. First install the module in your project, then add the code to your config file, lastly start codex, wait a few seconds, and verify with /mcp
Install in project
npm install -g @upstash/context7-mcp
Add to ~/.codex/config.toml
[mcp_servers.context7]
args = ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
command = "npx"
Install in project
npm install -g mcp-remote
Add to ~/.codex/config.toml
[mcp_servers.context7]
command = "mcp-remote"
args = [
"https://mcp.context7.com/mcp",
"--header",
"CONTEXT7_API_KEY: XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
]
disabled = false
I hope this helps someone.
VladimirLevadnij commentedon Sep 16, 2025
@tekn0x I'm glad to hear that everything worked out for you. I hope that everything else in your life is fine, except for this problem. Everything works out, everything is moving towards a bright future, you are not being abducted by aliens👽, there is no evil dog living next to you 🐕 and so on 😁
wbdb commentedon Sep 17, 2025
For Windows users, this works for me with Codex 0.38.0:
Opawn commentedon Sep 18, 2025
I configured it successfully, as shown below:
DanielTrindade commentedon Sep 21, 2025
@Opawn thanks man
just-pthai-it commentedon Sep 21, 2025
YOU SAVED MY LIFE
malore350 commentedon Sep 21, 2025
This one worked for me, if anyone is interested, supabase communication would work similarly:
[mcp_servers.supabase]
command = "cmd"
args = [
"/c",
"npx",
"-y",
"@supabase/mcp-server-supabase@latest",
"--read-only",
"--project-ref=project_ref"
]
env = { SystemRoot="C:\Windows", "SUPABASE_ACCESS_TOKEN" = "your_key" }
startup_timeout_ms = 20_000
dszdsxc19 commentedon Sep 27, 2025
If u r using uv, what works for me is declaring the python of the project used, for example:
Voilett commentedon Sep 30, 2025
nice work!
fix: improve MCP server initialization error handling openai#3196 ope…
AndreyElyan commentedon Oct 5, 2025
Fetching comments for context
kingbluetooth commentedon Oct 8, 2025
Despite trying the solutions in this thead for Windows (no WSL), I landed on the working config below:
Working Solution for Codex v0.45.0
Run npm install -g mcp-remotefix: improve MCP server initialization error handling openai#3196 ope…