[BUG] stdio MCP server always times out at ~30000ms on Windows, even though it connects via MCP Inspector)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Bug Report: stdio MCP server always times out at ~30000ms on Windows, even though the server itself connects successfully via MCP Inspector
Environment
- Claude Code: v2.1.220 (native install)
- Install path: C:\Users\<user>\.local\bin\claude.exe
- Config install method: native
- Platform: win32-x64 (Windows), tested in standalone PowerShell 7.6.4 (Windows Terminal), not VS Code integrated terminal
- MCP server: Oracle SQLcl (
sql.exe -mcp), stdio transport
.mcp.json
\\\json\
{
"mcpServers": {
"sqlcl": {
"type": "stdio",
"command": "C:\\sqlcl-latest\\sqlcl\\bin\\sql.exe",
"args": ["-mcp"]
}
}
}
\\
What's Wrong?
The "sqlcl" stdio MCP server always fails to connect from Claude Code CLI with a generic timeout, even though the exact same binary/command connects successfully and quickly (~11s) when tested through the official MCP Inspector (npx @modelcontextprotocol/inspector <command>).
Debug log (relevant lines)
\\\\
[DEBUG] MCP server "sqlcl": Starting connection with timeout of 30000ms
[DEBUG] MCP server "sqlcl": Connection timeout triggered after ~30000ms (limit: 30000ms)
[DEBUG] MCP server "sqlcl": Connection failed after ~30000ms: MCP server "sqlcl" connection timed out after 30000ms
[ERROR] MCP server "sqlcl" Connection failed: MCP server "sqlcl" connection timed out after 30000ms
\\
No additional stderr/child-process output is surfaced in the debug log for this stdio server (unlike HTTP-transport servers, which log Environment/transport details — see e.g. the "github" server's HTTP transport logs in the same session).
Steps to Reproduce
- Configure a native .exe as a stdio MCP server in
.mcp.json(see above). - Start Claude Code in the project directory:
claude - Run
/mcp— server shows✘ failedafter ~30s.
What I've already ruled out
- Server-side issue: Manually running
C:\sqlcl-latest\sqlcl\bin\sql.exe -mcpin a terminal starts instantly and prints "MCP Server started successfully". - stdout pollution: Redirected stdout/stderr separately (
sql.exe -mcp > out.txt 2> err.txt); confirmed the startup banner goes to stderr only — stdout is clean. - MCP protocol implementation issue: Verified with
npx @modelcontextprotocol/inspector "C:\sqlcl-latest\sqlcl\bin\sql.exe" -mcp— connects successfully in 11305ms, handshake completes, capability negotiation (MCP 2024-11-05) succeeds. - Resource contention from multiple stdio servers: Isolated test with only "sqlcl" enabled (removed "playwright" and "desktop-commander" via
claude mcp remove ... -s local) — still times out identically. - env key stripping parent environment: Removed
"env": {}from.mcp.jsonentirely — still times out identically. - Shell wrapping: Changed
commandto"cmd"withargs: ["/c", "C:\\sqlcl-latest\\sqlcl\\bin\\sql.exe", "-mcp"]— still times out identically. - VS Code integrated terminal pty issue: Reproduced in a standalone PowerShell 7.6.4 window (not VS Code) — still times out identically.
- Corrupted/incomplete install: Full uninstall (
Remove-Itemon.local\bin\claude.exeand.local\share\claude) and reinstall viairm https://claude.ai/install.ps1 | iex, tested in a fresh terminal session and fresh Claude Code session (no-cresume) — still times out identically. - Multiple GitHub scopes / other MCP config conflicts: Unrelated "github" server conflicting-scopes warning present throughout, but "github" (HTTP transport) connects fine in every test; only the stdio server is affected.
Expected Behavior
The "sqlcl" stdio MCP server should connect within a few seconds, consistent with its behavior under MCP Inspector.
Additional Notes
- Claude Code's debug log noted
Using bash path: "C:\Program Files\Git\bin\bash.exe"at startup, suggesting some Windows process-spawning may route through Git Bash. This may be relevant to how stdio MCP child processes are spawned on Windows, though I have not been able to verify this directly. - Happy to provide the full
--debuglog or test additional configurations if useful.
What Should Happen?
sqlcl should connect within seconds (as it does via MCP Inspector), not time out at 30000ms every time.
Error Messages/Logs
Steps to Reproduce
- Create a
.mcp.jsonfile in a project root with a stdio-type MCP server pointing to a local native executable:
{
"mcpServers": {
"sqlcl": {
"type": "stdio",
"command": "C:\\sqlcl-latest\\sqlcl\\bin\\sql.exe",
"args": ["-mcp"]
}
}
}
(This example uses Oracle SQLcl's built-in MCP server mode, but the issue is not specific to SQLcl — see "What I've already ruled out" below.)
- Start Claude Code in that project directory:
claude
- Run:
/mcp
- Observe that the "sqlcl" server shows "✘ failed" after approximately 30 seconds.
- For comparison, verify the same command connects successfully outside Claude Code:
npx @modelcontextprotocol/inspector "C:\sqlcl-latest\sqlcl\bin\sql.exe" -mcp
→ Connects successfully in ~11 seconds via MCP Inspector's web UI, confirming the server itself and its MCP protocol implementation are working correctly.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.220
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
Note: I was only able to test this with the SQLcl binary I have available. The issue may reproduce with any native .exe configured as a stdio MCP server on Windows — I have not yet had a chance to test with a more universally available binary. Happy to test additional repro cases if the maintainers have a suggestion for one.