desktop-commander never responds to MCP initialize on Windows (stdio server hangs indefinitely, no output)
Upstream Bug Report — Desktop Commander MCP server never responds to initialize on Windows
Status: Drafted, not filed. Ready to submit to the @wonderwhy-er/desktop-commander issue tracker once reviewed. Paths below use %USERPROFILE%/<npm-cache> placeholders in place of the actual machine's username and custom npm cache location.
Title
desktop-commander never responds to MCP initialize on Windows — process starts, stays alive, produces zero stdout/stderr indefinitely
Environment
- OS: Windows 10 Pro N, build 10.0.19045
- Node.js: v24.19.0
- npm: 11.17.0
- Package versions tested:
0.2.51(@latestat time of testing) and0.2.47— both exhibit identical behavior - Invocation context: as an MCP
stdioserver, configured for Claude Code (mcpServersentry withcommand/argsspawning the package vianpx)
Summary
When configured as a Claude Code MCP stdio server, desktop-commander never completes the MCP initialize handshake. The client (Claude Code) reports a connection timeout after 30 seconds. This is reproducible completely outside Claude Code with a bare Node.js script and persists regardless of how the process is spawned, which package version is used, or how long the client waits.
Steps to reproduce
Minimal reproduction, no MCP client required:
const { spawn } = require('child_process');
const proc = spawn(process.execPath, ['<npm-cache>/_npx/<hash>/node_modules/@wonderwhy-er/desktop-commander/dist/index.js'], { shell: false });
proc.stdout.on('data', d => console.log('STDOUT', d.toString()));
proc.stderr.on('data', d => console.log('STDERR', d.toString()));
proc.on('exit', (c, s) => console.log('EXIT', c, s));
setTimeout(() => {
const init = JSON.stringify({
jsonrpc: "2.0", id: 1, method: "initialize",
params: { protocolVersion: "2024-11-05", capabilities: {}, clientInfo: { name: "test", version: "1.0.0" } }
}) + "\n";
proc.stdin.write(init);
}, 3000);Also reproduces identically via the documented MCP client invocation:
npx @wonderwhy-er/desktop-commander@latestand via a Windows-safe shell wrapper:
cmd /c npx @wonderwhy-er/desktop-commander@latestExpected behavior
Per the MCP stdio transport spec, the server should respond to the initialize request on stdout with a JSON-RPC result within a reasonable time (well under Claude Code's 30-second connection timeout).
Actual behavior
No response is ever received. Specifically observed:
- Zero bytes written to stdout or stderr, for as long as 150 seconds (5x the typical MCP client timeout) in an extended test.
- The process does not exit or crash — it stays alive and has to be killed externally.
- This is identical across three independent spawn methods (
npxwithshell:false,npxwithshell:true/cmd /c, and a completely barenode dist/index.jsinvocation with no npx/npm/shell involved at all). - Identical on both
0.2.47(2026-08-04 release) and0.2.51(@latestat test time, 2026-09-17 release) — not a recent regression.
Diagnostic evidence already gathered
To rule out environment/configuration causes before filing this:
- Package resolution succeeds. npm's own debug logs show
npm exec @wonderwhy-er/desktop-commander@latestresolving the package via a fast (<2.5s), successful registry fetch,exit 0. - Not a Windows
npx/shell spawn issue, despite Windows requiring a shell to execute thenpx.cmdshim (spawn('npx', args, {shell:false})does throwENOENTon Windows, and thecmd /c npx ...wrapper correctly works around that specific issue) — the identical silent-hang symptom reproduces even with a completely barenode dist/index.jsinvocation that involves no shell or npx at all. - Not blocked on network. Config loading (
config-manager.js) is purely local filesystem I/O with no network calls. Feature-flag loading (utils/feature-flags.js) explicitly fires its remote fetch in the background (.then(), not awaited) specifically so it "don't block startup," per the source's own comment. The package's telemetry endpoints (telemetry.desktopcommander.appand its Cloud Run fallback) both responded in under 0.5 seconds when tested directly. - Not a general environment stdio issue. A trivial unrelated Node child-process stdin/stdout echo test in the same environment worked correctly and instantly.
- Not an ESM/module-type mismatch.
package.jsoncorrectly declares"type": "module"; a real mismatch would produce an immediate, loudSyntaxError, which was never observed. - Not a silently-swallowed exception. The package's own top-level
runServer().catch(...)handler writes directly toprocess.stderr(bypassing the package's own stdout-filtering transport) on any rejection. stderr was completely empty across every test, meaningrunServer()has not thrown. - Not the package's custom stdio transport filtering the response.
custom-stdio.js'sFilteredStdioServerTransportonly buffers non-JSON-RPC console output before the handshake completes; any string containing"jsonrpc"/"method"/"id"(i.e. a real protocol message, including theinitializeresponse) passes straight through to real stdout unfiltered. - Live debugger attach (
node --inspect-brk) shows the main thread never returns to a JS statement boundary. Attached via the Chrome DevTools Protocol, resumed the initial--inspect-brkpause, sent a realinitializerequest, then issued an explicitDebugger.pause()3 seconds later to force a call-stack snapshot. NoDebugger.pausedevent fired — consistent with the process being blocked inside a synchronous native call rather than idling with nothing scheduled. dist/bootstrap.js(the first-imported module) is not the blocking call. Its only executable statement is a plainprocess.env.UV_THREADPOOL_SIZEstring assignment — reviewed directly, confirmed harmless.- Not a timing/slow-resolution issue. Extended the observation window to 150 seconds (5x the typical client timeout): zero output at every checkpoint (30s/60s/90s/120s/150s). Given enough time, it still never responds — this is not a "just needs longer to start" situation.
- Ruled out an unrelated environmental factor specific to this machine: a Windows Startup-folder watchdog was found continuously running its own
desktop-commander ... remotebackground process throughout testing. Stopping that process entirely and immediately re-testing produced the identical timeout, ruling it out as a contributing cause.
Additional context
This was diagnosed as part of setting up desktop-commander as a Claude Code MCP server on Windows. A second, unrelated MCP server (@playwright/mcp) exhibits the same CONNECT_TIMEOUT symptom in the same environment, which was a useful early signal that the issue might be environmental — but the elimination work above (points 1–11) was performed specifically against desktop-commander and shows the failure is internal to this package's own startup path, not the spawn mechanism, the shell, npm/npx, or this specific machine's other background processes.
Given the module-import-evaluation-level instrumentation (writing directly into the package's compiled dist/*.js files, at the top of every directly-imported module, syntax-verified and checksum-restored afterward) also produced zero output even from the very first import, the actual blocking point could not be pinpointed at the JavaScript level at all — it appears to occur either during Node's own module resolution/loading of this package's dependency graph, or inside a native call somewhere in that graph, before any of the package's own JS code demonstrably begins executing.
What would help maintainers investigate further
- Confirmation of whether
desktop-commanderis known to work as a plain MCP stdio server on Windows at all (vs. primarily tested/supported via its "remote" mode or on other platforms). - Any native addons or synchronous startup checks in the dependency graph that could block before the transport is even constructed.
- Whether a
--verbose/debug flag exists that logs before the custom stdio transport installs its console/stdout overrides (which would otherwise suppress early diagnostic output).
Source: wonderwhy-er/DesktopCommanderMCP