Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-stdio-windows-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@modelcontextprotocol/sdk': patch
---

Always set windowsHide to true when spawning stdio server processes on Windows, not just in Electron environments.
8 changes: 3 additions & 5 deletions src/client/stdio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ export class StdioClientTransport implements Transport {
},
stdio: ['pipe', 'pipe', this._serverParams.stderr ?? 'inherit'],
shell: false,
windowsHide: process.platform === 'win32' && isElectron(),
// Always hide the console window on Windows, not just in Electron.
// The option is a no-op on other platforms.
windowsHide: true,
cwd: this._serverParams.cwd
});

Expand Down Expand Up @@ -257,7 +259,3 @@ export class StdioClientTransport implements Transport {
});
}
}

function isElectron() {
return 'type' in process;
}
Loading