Skip to content

Commit 470fe4e

Browse files
its-mashclaude
andcommitted
fix: suppress console window for stdio MCP servers in release builds
The gateway's StdioTransport was missing the CREATE_NO_WINDOW flag when spawning child processes. In release builds, the Tauri app uses windows_subsystem = "windows" (GUI subsystem), which causes Windows to allocate a new visible console for each spawned console-subsystem child process. This adds the same CREATE_NO_WINDOW (0x08000000) creation flag already used in the mcpmux-mcp crate's transport. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
1 parent 2b4f90a commit 470fe4e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • crates/mcpmux-gateway/src/pool/transport

crates/mcpmux-gateway/src/pool/transport/stdio.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,16 @@ impl Transport for StdioTransport {
125125
.stderr(Stdio::piped()) // Capture stderr for logging
126126
.kill_on_drop(true);
127127

128+
// On Windows, prevent console window from appearing for child processes.
129+
// In release builds the app uses `windows_subsystem = "windows"` (GUI subsystem),
130+
// which causes Windows to allocate a new visible console for any spawned
131+
// console-subsystem child process. CREATE_NO_WINDOW suppresses this.
132+
#[cfg(windows)]
133+
{
134+
const CREATE_NO_WINDOW: u32 = 0x08000000;
135+
cmd.creation_flags(CREATE_NO_WINDOW);
136+
}
137+
128138
// Note: We can't easily access stderr after TokioChildProcess wraps it
129139
// This is a limitation of the current rmcp API
130140
// For now, we log connection events only

0 commit comments

Comments
 (0)