Suppress console windows for local Windows MCP servers (#48238)

## What changed

Expose Windows process creation flags on the shared command wrapper and use
`CREATE_NO_WINDOW` when launching local stdio MCP servers, including fallback
launches without Job Object containment. Preserve `CREATE_SUSPENDED` when
assigning the server to a Job Object before execution.

## Testing

Add a Windows regression test covering direct launches and launches through
`cmd.exe`. Verify that the server has no console, initializes successfully,
returns tools, and exits after shutdown.

GitOrigin-RevId: 84475e82999d91a431e09327d4f5639b59c01427
This commit is contained in:
malsamiri-oai
2026-09-25 16:52:50 -07:00
committed by Ian MacLeod
parent 5c3671c1a0
commit bd5b3b7a20
4 changed files with 108 additions and 0 deletions
+6
View File
@@ -233,6 +233,12 @@ impl Command {
self
}
/// Set the Windows process creation flags, replacing any previously selected flags.
#[cfg(windows)]
pub fn creation_flags(&mut self, flags: u32) -> &mut Self {
self.inner.creation_flags(flags);
self
}
/// Preserve Job Object assignment before the child begins executing on Windows.
#[cfg(windows)]
pub fn prepare_suspended_spawn(&mut self, job: &crate::JobObject) {