Kiro icon indicating copy to clipboard operation
Kiro copied to clipboard

MCP stdio servers spawn visible CMD windows on Windows

Open rwa-alfieopo opened this issue 5 months ago • 31 comments

Before opening, please confirm:

Operating System

Windows 11

Kiro Version

kiro-cli 2.9.0

Bug Description

Every MCP server configured with stdio transport spawns a visible CMD window that stays open for the entire session. With 4 MCP servers configured, 4 CMD windows appear on startup. The bundled MCP SDK already has windowsHide: process.platform === 'win32' but the Bun runtime spawn path does not pass this option through to the OS.

Steps to Reproduce

  1. Open kiro-cli on Windows 11 with a custom agent configured with 2+ stdio MCP servers
  2. Run kiro-cli chat
  3. Observe multiple CMD windows spawning and remaining visible for the session duration

Expected Behavior

MCP server processes should spawn hidden with no visible CMD windows. The windowsHide option should be passed through when spawning stdio MCP server child processes on Windows.

Conversation ID

No response

Additional Context

The bundled MCP SDK at kas/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.js (line 80) already sets windowsHide correctly:

  windowsHide: process.platform === 'win32'

However, kiro-cli uses a Bun runtime (tui.js) that spawns MCP processes via Bun.spawn which does not support windowsHide. The fix likely needs to use CREATE_NO_WINDOW process creation flag or switch to Node's child_process.spawn for MCP servers on Windows.

Same root cause as anthropics/claude-code#24708.

rwa-alfieopo avatar Jun 24 '26 08:06 rwa-alfieopo

This is not good update!.

rwa-alfieopo avatar Jun 24 '26 08:06 rwa-alfieopo

🤖 Potential Duplicate Detected

This issue appears to be similar to:

What happens next?

  • ⏰ This issue will be automatically closed in 3 days
  • 🏷️ If this is not a duplicate, you can prevent automatic closure by adding a comment or reacting with 👎 to this message.
  • 💬 Comment on the original issue if you have additional information

Why is this marked as duplicate? Both issues report MCP server problems on Windows 11 with the CLI, involving stdio transport and process spawning failures. Issue #8743 covers broken stdin pipe and pipe character interpretation in args, while the new issue covers visible CMD windows due to missing windowsHide flag — same platform, same MCP stdio transport layer, closely related root causes in the Windows process spawning path.

github-actions[bot] avatar Jun 24 '26 08:06 github-actions[bot]

I'm also experiencing this on 2.9.0 (Windows 11, Build 26200) with 16 MCP servers configured.

After further testing, the issue is specifically in the new TUI mode (tui.js updated June 24). Here's what I found:

Mode MCP CMD popups
kiro-cli chat (new TUI) ❌ Broken ❌ Popups
kiro-cli chat --legacy-ui ✅ Works ✅ No popups
kiro-cli acp (programmatic) ✅ Works ✅ No popups

The new TUI's MCP spawn path is broken on Windows — both windowsHide and stdio pipe handling. The --legacy-ui and acp modes use a different code path and work perfectly with the same mcp.json on the same machine.

Workaround: kiro-cli chat --agent myagent --trust-all-tools --legacy-ui

rekkles-liu avatar Jun 24 '26 08:06 rekkles-liu

Thank you for your feedback! 🙏

The duplicate label has been removed and this issue has been sent back for maintainer review.

A maintainer will review this issue shortly.

github-actions[bot] avatar Jun 24 '26 08:06 github-actions[bot]

This is affecting everyone on this new update. I can't run kiro without dozens of windows popping up. Please fix.

kompleksanda avatar Jun 24 '26 11:06 kompleksanda

Thanks for the detailed report, and @rekkles-liu for the excellent isolation showing this is TUI-only.

We've identified a likely root cause: the TUI spawns the ACP agent subprocess with detached: true but without windowsHide: true, which on Windows might create a new visible console window for the process tree (including all MCP servers).

The fix would involve adding windowsHide: true to the spawn options. We're investigating and will aim to get this into an upcoming release.

Workaround: Use kiro-cli chat --legacy-ui which doesn't have this issue.

AnilMaktala avatar Jun 24 '26 13:06 AnilMaktala

While some of the other comments imply it, I want to explicitly call out that this is a regression. This behaviour was not present in versions 2.8.0 or 2.8.1.

This suggests that something changed in tui.js that affects the way child processes are spawned on Windows starting in v2.9.0.

jsmythsci avatar Jun 24 '26 14:06 jsmythsci

I can confirm that this issue is still present in Kiro CLI new version 2.10.0. I upgraded to the latest version and reproduced the same behavior without any changes.

santanagabriel avatar Jun 26 '26 13:06 santanagabriel

yes, running into the same issue this morning with 2.9.

o0Ninjaz0o avatar Jun 26 '26 13:06 o0Ninjaz0o

Experimenting the same issue with CLI 2.10.0

marcoseloso77 avatar Jun 26 '26 14:06 marcoseloso77

tá horrivel isso!

mascarenhasjp avatar Jun 29 '26 00:06 mascarenhasjp

any update on this issue?

o0Ninjaz0o avatar Jun 30 '26 13:06 o0Ninjaz0o

any update on this issue?

Unfortunately no, I’m suffering a lot with this problem, I can’t send commands because it always spawns Windows windows on the screen, I can’t do anything, seriously thinking about giving up on kiro

mascarenhasjp avatar Jun 30 '26 13:06 mascarenhasjp

I can confirm that this issue is still present in Kiro CLI new version 2.10.0. I upgraded to the latest version and reproduced the same behavior without any changes.

Seria bom se tivesse como voltar versões, tipo 2.8 exemplo

mascarenhasjp avatar Jun 30 '26 13:06 mascarenhasjp

This is a serious issue. I'm surprised that a fix hasn't been rolled out yet.

wmild avatar Jun 30 '26 15:06 wmild

Why it takes so long to fix it?

marcoseloso77 avatar Jun 30 '26 23:06 marcoseloso77

There were issues already with this before, but 2.8 or 2.9 made it worse. Please fix this. Every shell call made by Kiro opens a new window. Every background agent that checks something opens a window, every session opens a window for each MCP. This is stupid. We use other tools, we know it does not have to be like that.

eventh0riz0n avatar Jul 01 '26 17:07 eventh0riz0n

Windows Regression: Visible cmd.exe / conhost.exe Windows for Every Shell Invocation (v2.10.0)

Affected Environment

  • OS: Windows 11 Pro (x64)
  • Kiro CLI: 2.10.0
  • Terminal: Windows Terminal (PowerShell)
  • Previous working version: 2.8.x

Impact

This regression is severely impacting productivity. Every shell tool invocation spawns a visible cmd.exe / conhost.exe window that:

  • Flashes on screen and steals focus from active work.
  • Occurs multiple times per task (5–10+ windows in rapid succession).
  • Makes it impossible to work on anything else while the agent is executing.

Business Impact

This is not a cosmetic issue—it is a workflow-breaking regression that renders Kiro CLI effectively unusable on Windows for any task involving shell commands.

The tool worked flawlessly in 2.8.x. The 2.10.0 upgrade introduced this behavior without any known workaround.

As a daily user who relies heavily on Kiro CLI for development workflows, this issue is forcing evaluation of alternative tools. The lack of a fix—or even a documented workaround—after multiple community reports is concerning.

Expected Resolution

The fix is well understood and straightforward: set the Windows process creation flag CREATE_NO_WINDOW (0x08000000) when spawning background child processes.

This is standard practice for applications that launch background processes on Windows and prevents unnecessary console windows from appearing.

Request

Please prioritize this as a P1 hotfix rather than deferring it to a future release cycle. This regression has a significant impact on the usability of Kiro CLI for Windows developers.

manjeetdangidev avatar Jul 02 '26 14:07 manjeetdangidev

@manjeetdangidev wrote:

The lack of a fix—or even a documented workaround—after multiple community reports is concerning.

There is a documented workaround, and has been since ~30 minutes after this issue was raised.

...this issue is forcing evaluation of alternative tools.

Have you evaluated kiro-cli chat --legacy-ui?


To those posting various forms of "me too," please stop. @AnilMaktala already stated (presumably on behalf of the development team) that they are aware of the issue and are investigating. I promise you, adding a "me too" comment is not going to get the issue addressed any quicker.

jsmythsci avatar Jul 02 '26 16:07 jsmythsci

kiro-cli chat --legacy-ui does not allow to use --resume-picker or --resume-id

BatStak avatar Jul 03 '26 07:07 BatStak