Skip to content

fix(stdio): always set windowsHide on Windows, not just in Electron#1640

Open
jnMetaCode wants to merge 2 commits intomodelcontextprotocol:v1.xfrom
jnMetaCode:fix/stdio-windows-hide
Open

fix(stdio): always set windowsHide on Windows, not just in Electron#1640
jnMetaCode wants to merge 2 commits intomodelcontextprotocol:v1.xfrom
jnMetaCode:fix/stdio-windows-hide

Conversation

@jnMetaCode
Copy link

Summary

StdioClientTransport only sets windowsHide: true when running inside
Electron, but non-Electron Node.js apps on Windows also get an unwanted
cmd.exe console window when spawning MCP server processes.

Since windowsHide is a no-op on non-Windows platforms, this PR sets it
to true unconditionally. The now-unused isElectron() helper is removed.

Related issue

Fixes #1638

Changes

  • src/client/stdio.ts: windowsHide: true (was process.platform === 'win32' && isElectron())
  • Removed unused isElectron() function

The windowsHide spawn option was only enabled for Electron apps, causing
an empty cmd.exe console window to appear when launching MCP servers
from non-Electron Node.js applications on Windows.

Since windowsHide is a no-op on non-Windows platforms, just set it to
true unconditionally. Also removes the now-unused isElectron() helper.

Fixes modelcontextprotocol#1638
@jnMetaCode jnMetaCode requested a review from a team as a code owner March 7, 2026 04:40
@changeset-bot
Copy link

changeset-bot bot commented Mar 7, 2026

🦋 Changeset detected

Latest commit: 3041e0d

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 7, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@modelcontextprotocol/sdk@1640

commit: 169bd68

@KalebCole
Copy link

KalebCole commented Mar 13, 2026

+1 — hitting this exact bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants