Skip to content

Commit d5c0e86

Browse files
authored
Merge pull request #68 from modelcontextprotocol/ani/fix-npx
Fix npx and other processes that launch subprocesses
2 parents 8f89fb2 + 9fd52c8 commit d5c0e86

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/client/stdio.ts

+3-12
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export class StdioClientTransport implements Transport {
100100
async start(): Promise<void> {
101101
if (this._process) {
102102
throw new Error(
103-
"StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.",
103+
"StdioClientTransport already started! If using Client class, note that connect() calls start() automatically."
104104
);
105105
}
106106

@@ -113,17 +113,8 @@ export class StdioClientTransport implements Transport {
113113
stdio: ["pipe", "pipe", this._serverParams.stderr ?? "inherit"],
114114
shell: false,
115115
signal: this._abortController.signal,
116-
117-
// NB: The behavior of detached varies based on platform, and also
118-
// is different based on whether the process is a Win32 Subsystem
119-
// process or a Console Subsystem process. Strangely, the behavior
120-
// of detached is almost 1:1 the opposite in Electron+Windows vs
121-
// what is documented on the node.js website, and also is different
122-
// based on whether you launch Electron in a development environment
123-
// (i.e. via `electron-forge start`) vs a production environment
124-
// (i.e. YourApp.exe).
125-
detached: process.platform === "win32" && isElectron(),
126-
},
116+
windowsHide: process.platform === "win32" && isElectron(),
117+
}
127118
);
128119

129120
this._process.on("error", (error) => {

0 commit comments

Comments
 (0)