Skip to content

fix: always set windowsHide on Windows for stdio transport#1706

Open
ctonneslan wants to merge 1 commit intomodelcontextprotocol:mainfrom
ctonneslan:fix/stdio-windows-hide-all-apps
Open

fix: always set windowsHide on Windows for stdio transport#1706
ctonneslan wants to merge 1 commit intomodelcontextprotocol:mainfrom
ctonneslan:fix/stdio-windows-hide-all-apps

Conversation

@ctonneslan
Copy link

Summary

Set windowsHide to true for all Windows apps when spawning MCP servers via stdio, not just Electron apps. This prevents an empty cmd.exe console window from appearing.

Problem

The current code only sets windowsHide: true when running inside Electron:

windowsHide: process.platform === 'win32' && isElectron(),

Non-Electron Windows apps (VS Code extensions, CLI tools, etc.) also spawn MCP servers and get an unwanted console window.

Fix

  • Changed condition to windowsHide: process.platform === 'win32'
  • Removed the now-unused isElectron() helper

The windowsHide option is a no-op on non-Windows platforms, so this is safe to always set on Windows.

Fixes #1638

Set windowsHide to true for all Windows apps, not just Electron.
Non-Electron apps (e.g., VS Code extensions, CLI tools) also show
an empty cmd.exe console window when spawning MCP servers via stdio.

Remove the now-unused isElectron() helper.

Fixes modelcontextprotocol#1638
@ctonneslan ctonneslan requested a review from a team as a code owner March 19, 2026 00:27
@changeset-bot
Copy link

changeset-bot bot commented Mar 19, 2026

⚠️ No Changeset found

Latest commit: 353d7ad

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 19, 2026

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/client@1706

@modelcontextprotocol/server

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/server@1706

@modelcontextprotocol/express

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/express@1706

@modelcontextprotocol/hono

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/hono@1706

@modelcontextprotocol/node

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/node@1706

commit: 353d7ad

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.

Stdio client does not set windowsHide

1 participant