MCP servers are not working on windows
Resolved 💬 17 comments Opened Sep 12, 2025 by T1nker-1220 Closed Nov 26, 2025
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
codex-cli 0.31.0
Which model were you using?
gpt5
What platform is your computer?
windows 11 pro
What steps can reproduce the bug?
the npx is not working
tool running...
firebase-afterdark.firebase_query({"target":"firestore","operation":"list_collections","params":{}})
tool failed, duration: 1m20s
firebase-afterdark.firebase_query({"target":"firestore","operation":"list_collections","params":{}})
Error: tool call error: tool call failed for `firebase-afterdark/firebase_query`
tool running...
context7.resolve-library-id({"libraryName":"Next.js 14.1.1"})
tool success, duration: 3ms
context7.resolve-library-id({"libraryName":"Next.js 14.1.1"})
Error searching libraries: TypeError: fetch failed
> Network is still restricted, so Context7 lookups are failing.
[mcp_servers.context7]
command = "node"
args = ["C:/Users/NATH/Documents/Cline/MCP/context7/dist/index.js"]
type = "stdio"
[mcp_servers.playwright]
command = "node"
args = ["C:/Users/NATH/Documents/Cline/MCP/playwright-mcp/lib/index.js"]
type = "stdio"
What is the expected behavior?
_No response_
What do you see instead?
_No response_
Additional information
_No response_
17 Comments
There's a good way to do this: check the configuration paths for your commands. This way, you can configure multiple MCPs for uv, uvx, and npx. Here are some examples:
[mcp_servers.context7]
type = "stdio"
command = 'C:\\Program Files\\nodejs\\npx.cmd'
args = ["-y", "@upstash/context7-mcp@latest"]
env = { APPDATA = 'C:\\Users\\lenovo\\AppData\\Roaming', LOCALAPPDATA = 'C:\\Users\\lenovo\\AppData\\Local', HOME = 'C:\\Users\\lenovo', SystemRoot = 'C:\\Windows' }
startup_timeout_ms = 20_000
[mcp_servers."perplexity-mcp"]
type = "stdio"
command = 'C:\Users\lenovo\.local\bin\uvx.exe'
args = ["perplexity-mcp"]
env = { PERPLEXITY_API_KEY = "XXXXXXX", PERPLEXITY_MODEL = "sonar", APPDATA = 'C:\\Users\\lenovo\\AppData\\Roaming', LOCALAPPDATA = 'C:\\Users\\lenovo\\AppData\\Local', HOME = 'C:\\Users\\lenovo', SystemRoot = 'C:\\Windows' }
[mcp_servers.serena]
type = "stdio"
command = 'C:\\Users\\lenovo\\.local\\bin\\uv.exe'
args = ["run", "--directory", "F:\\Homework\\MyMCP\\serena", "serena-mcp-server"]
env = { APPDATA = 'C:\\Users\\lenovo\\AppData\\Roaming', LOCALAPPDATA = 'C:\\Users\\lenovo\\AppData\\Local', HOME = 'C:\\Users\\lenovo', SystemRoot = 'C:\\Windows' }
startup_timeout_ms = 20_000
Of course, if you are sse please use this uv tool install mcp-proxy, here is an example:
[mcp_servers."graphiti-memory-stdio-via-proxy"]
type = "stdio"
command = 'C:\\Users\\lenovo\\.local\\bin\\uvx.exe'
args = ["mcp-proxy", "http://127.0.0.1:15627/sse"]
env = { APPDATA = 'C:\\Users\\lenovo\\AppData\\Roaming', LOCALAPPDATA = 'C:\\Users\\lenovo\\AppData\\Local', HOME = 'C:\\Users\\lenovo', SystemRoot = 'C:\\Windows' }
startup_timeout_ms = 20_000
I'm not able to run any MCPs on codex in native windows due to a winsocket error; switching to WSL resolves the issue
This is working in my end this is really cool
Love you, this is the first way I found that can run serena in my environment.
But I did a little bit adjustments to run it in VScode codex extension, here is my config:
I was able to get my MCP servers working yesterday as well by adding these environmental variables
APPDATA = 'C:\Users\...\AppData\Roaming'
LOCALAPPDATA = 'C:\Users\...\AppData\Local'
DOTNET_ROOT = 'C:\Program Files\dotnet'
HOME='C:\Users\...'
SystemRoot='C:\Windows'
Everything else was identical to my setup for claude code (didn't have to convert npx or uvx to the executable). Thanks all!
This is the format I used to get the MCP servers to work on Windows 11. You have to replace REDACTED with your own character sequence. Notice that I used "cmd" command instead of "npx"
`approval_policy = "never"
model = "gpt-5-codex"
[mcp_servers."firecrawl-mcp"]
command = "cmd"
args = ["/c", "npx", "-y", "firecrawl-mcp"]
startup_timeout_ms = 120000
[mcp_servers."firecrawl-mcp".env]
APPDATA = "C:\\Users\\Computer\\AppData\\Roaming"
LOCALAPPDATA = "C:\\Users\\Computer\\AppData\\Local"
HOME = "C:\\Users\\Computer"
SystemRoot = "C:\\Windows"
NODE_OPTIONS = "--dns-result-order=ipv4first"
FIRECRAWL_API_KEY = "fc-REDACTED"
[mcp_servers."playwright"]
command = "cmd"
args = ["/c", "npx", "-y", "@playwright/mcp@latest"]
startup_timeout_ms = 180000
[mcp_servers."playwright".env]
APPDATA = "C:\\Users\\Computer\\AppData\\Roaming"
LOCALAPPDATA = "C:\\Users\\Computer\\AppData\\Local"
HOME = "C:\\Users\\Computer"
SystemRoot = "C:\\Windows"
NODE_OPTIONS = "--dns-result-order=ipv4first"
[mcp_servers."context7"]
command = "cmd"
args = ["/c", "npx", "-y", "@upstash/context7-mcp", "--api-key", "ctx7sk-REDACTED"]
startup_timeout_ms = 120000
[mcp_servers."context7".env]
APPDATA = "C:\\Users\\Computer\\AppData\\Roaming"
LOCALAPPDATA = "C:\\Users\\Computer\\AppData\\Local"
HOME = "C:\\Users\\Computer"
SystemRoot = "C:\\Windows"
NODE_OPTIONS = "--dns-result-order=ipv4first"
[mcp_servers."supabase"]
command = "cmd"
args = ["/c", "npx", "-y", "@supabase/mcp-server-supabase@latest", "--read-only", "--project-ref=REDACTED"]
startup_timeout_ms = 120000
[mcp_servers."supabase".env]
APPDATA = "C:\\Users\\Computer\\AppData\\Roaming"
LOCALAPPDATA = "C:\\Users\\Computer\\AppData\\Local"
HOME = "C:\\Users\\Computer"
SystemRoot = "C:\\Windows"
NODE_OPTIONS = "--dns-result-order=ipv4first"
SUPABASE_ACCESS_TOKEN = "sbp_REDACTED"
`
mark,hope fix
+1
For Windows users, this works for me with Codex 0.38.0:
It looks like you can use it as long as there is information in the [.env].
The following settings can run correctly without any issues.
<img width="1440" height="823" alt="Image" src="https://github.com/user-attachments/assets/7df4e130-cd57-478a-9a56-314ffb4842f4" />
This works for me. I guess it should be these environmental variables that have played a role
On windows 11, with this setup:
I have this error on typing "codex" command:
Double-slashing fixed this:
Hi all,
Can I have help using a stdio mcp running via an .exe file?
I keep having this error
MCP client for autodeskAECModel failed to start: handshaking with MCP server failed: connection closed: initializeresponse
We have fixed many mcp-related bugs for Windows since this bug was first filed. If you're still seeing problems with the latest version of codex, please open a new bug report with details.
I find the problem.
In the code, I was having some Write.Console for debugging! Interesting, Claude Code don't care; instead, Codex was literally causing the handshaking to fail.