Skip to content

fix(mcp): hide console windows for stdio MCP servers on Windows - #1030

Merged
Xoshbin merged 1 commit into
Xoshbin:mainfrom
fhalim:fix/windows-mcp-no-window
Nov 18, 2026
Merged

Xoshbin merged 1 commit into
Xoshbin:mainfrom
fhalim:fix/windows-mcp-no-window

Conversation

@fhalim

@fhalim fhalim commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Problem

On Windows, every stdio MCP server opens a visible console window. `StdioTransportFactory::connect` spawns the server without `CREATE_NO_WINDOW`, and `npx`/`uvx`-style servers are console-subsystem programs or `.cmd` shims run via `cmd.exe`.

Change

Call the existing `crate::ai::cli::hide_console_window` helper (added in #819 for the AI CLI processes) on the MCP command before spawning. No new helper, no new constant; a no-op off Windows.

Verification

  • `cargo fmt --all --check` clean
  • `cargo test --lib mcp::transport`: 13 passed
  • Not yet verified by hand with a running `npx`-based MCP server on Windows.

Summary by CodeRabbit

  • Bug Fixes
    • Console windows are no longer displayed when launching MCP processes.

Stdio MCP servers were spawned without CREATE_NO_WINDOW, so on Windows each
`npx`/`uvx`-style server (a console-subsystem program or a `.cmd` shim run
via cmd.exe) opened a visible console window. Reuse the hide_console_window
helper added for the AI CLI processes in Xoshbin#819.
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The stdio transport now configures spawned commands to hide their console window before starting the child process.

Changes: Stdio transport

Layer / File(s) Summary
Configure stdio child command
asyar-launcher/src-tauri/src/mcp/transport.rs
connect configures the command to hide its console window after optional working-directory setup and before spawning.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Suggested reviewers: xoshbin

Merge Risk: Minimal · up to 253fa

This hides console windows for stdio MCP servers on Windows by reusing an existing helper, and it should have no effect on other platforms. No merge-blocking risk was found. The author has not yet run it against a real server on Windows.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the change: hiding console windows for stdio MCP servers on Windows. The raw summary says StdioTransportFactory::connect now calls hide_console_window before spawning the command, whic…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change: hiding console windows for stdio MCP servers on Windows. The raw summary says StdioTransportFactory::connect now calls hide_console_window before spawning the command, which matches the title's main point. The title follows the conventional fix(scope) form and is specific enough for a teammate scanning history to understand the primary change.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4268a0e8-de01-4cfd-be21-933a17a79ba8
Commits

Reviewing files that changed from the base of the PR and between 23ef13f and 253fa5b.

Files selected for processing: 1

  • asyar-launcher/src-tauri/src/mcp/transport.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@fhalim
fhalim marked this pull request as ready for review November 11, 2026 23:58
@Xoshbin

Xoshbin commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Hey @fhalim

Thanks, the change looks right to me. I'd like to smoke test it on Windows before merging, and I'm happy to wait — no rush.

Could you run a debug build on Windows 11 with a real npx-based MCP server and confirm no console window appears? The case I care about most is a server that crashes, since the supervisor retries a few times and each retry used to pop a new window.

Thanks!

@Xoshbin
Xoshbin merged commit 5c55edb into Xoshbin:main Nov 18, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants