fix(stdio): always set windowsHide on Windows, not just in Electron#1640
Open
jnMetaCode wants to merge 2 commits intomodelcontextprotocol:v1.xfrom
Open
fix(stdio): always set windowsHide on Windows, not just in Electron#1640jnMetaCode wants to merge 2 commits intomodelcontextprotocol:v1.xfrom
jnMetaCode wants to merge 2 commits intomodelcontextprotocol:v1.xfrom
Conversation
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
🦋 Changeset detectedLatest 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 |
commit: |
|
+1 — hitting this exact bug |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
StdioClientTransportonly setswindowsHide: truewhen running insideElectron, but non-Electron Node.js apps on Windows also get an unwanted
cmd.exe console window when spawning MCP server processes.
Since
windowsHideis a no-op on non-Windows platforms, this PR sets itto
trueunconditionally. The now-unusedisElectron()helper is removed.Related issue
Fixes #1638
Changes
src/client/stdio.ts:windowsHide: true(wasprocess.platform === 'win32' && isElectron())isElectron()function