Windows: MCP server spawning causes brief console window flash (missing CREATE_NO_WINDOW flag)
Description
On Windows, every time Claude Code starts or restarts an MCP server, a console window briefly flashes on screen. This is a cosmetic issue but noticeable and annoying for users.
Root cause
Claude Code spawns MCP server processes (e.g. node script.js) without the windowsHide: true option in Node.js child_process.spawn. On Windows, this maps to the absence of the CREATE_NO_WINDOW (0x08000000) flag in CreateProcess. When a GUI application (Electron) spawns a console subsystem executable without this flag, Windows briefly creates and shows a console window before the process settles.
The fix is a one-liner in the MCP server spawning code:
// before
spawn(command, args, { stdio: [...] })
// after
spawn(command, args, { stdio: [...], windowsHide: true })
Steps to reproduce
- Windows 10/11
- Configure any MCP server in
~/.claude.jsonthat runs a console application (node, python, etc.) - Start Claude Code
- Observe a brief console window flash on screen at startup
Environment
- OS: Windows 11
- Claude Code version: latest
- Reproducible with any stdio MCP server (confirmed with
@colbymchenry/codegraph)
Expected behavior
No console window visible when MCP servers start in the background.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗