Windows: npm-shim spawnSync missing windowsHide flashes a console window on every MCP server launch
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 86/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, node.js
Línea de trabajo
Empieza leyendo npm-shim.js y localizando las llamadas a spawnSync en el shim y en extract(). Verifícalo en Windows iniciando codegraph.cmd serve --mcp desde un proceso padre oculto; estará listo cuando ninguna de las dos rutas de inicio muestre una consola y el servidor MCP de stdio siga iniciándose normalmente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Environment
- OS: Windows 10/11
- Install:
npm i -g @colbymchenry/codegraph(v1.0.1) - Launched as a stdio MCP server via
codegraph.cmd serve --mcp(registered in.mcp.json/ agent MCP configs)
Symptom
Every time an MCP host launches the server, a console window briefly flashes whose title is the full path to ... ode_modules\@colbymchenry\codegraph-win32-x64 ode.exe. Hosts that spawn child processes hidden (e.g. Kimi Code / Kimi Work use windowsHide: true, which maps to CREATE_NO_WINDOW) run the entire launch chain console-less, so the final spawnSync in npm-shim.js creates a brand-new visible console for the bundled node.exe. The window reappears on every launch / reconnect.
Root cause
In npm-shim.js:
var res = childProcess.spawnSync(resolved.command, resolved.args, { stdio: 'inherit' });
windowsHide defaults to false in Node. On Windows, when the parent process has no console, a spawned console-subsystem child is allocated a new visible console, titled with the child's own image path - exactly what users observe.
Everything under the platform package's lib/dist already passes windowsHide: true (daemon spawn in mcp/index.js, liveness watchdog, all git calls). Only the npm shim's spawnSync, and the tar call in extract() on the self-heal path, miss it.
Suggested fix
var res = childProcess.spawnSync(resolved.command, resolved.args, { stdio: 'inherit', windowsHide: true });
(and add windowsHide: true to the spawnSync('tar', ...) in extract().)
Verification
Reproduced by launching codegraph.cmd serve --mcp from a parent created with CREATE_NO_WINDOW and polling top-level window titles (user32.EnumWindows at 200 ms - the window is transient):
- Before the patch: a console window appears, titled exactly with the bundled node.exe path.
- After adding
windowsHide: true: no window at all; the server starts normally (proxy -> daemon -> liveness watchdog all healthy) and the stdio MCP transport is unaffected.
Notes
- This affects every Windows MCP host that hides its child consoles (Kimi Code/Work, Claude Code, ...), so the fix belongs in the shim rather than per-host workarounds.
- A local patch works, but any
npm update -g @colbymchenry/codegraphoverwrites it.
- Lenguaje dominante
- C
- Estrellas
- 73.2k
- Forks
- 4.7k
- Merge medio
- 3 h 31 min
- PR fusionados (30 d)
- 546
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de colbymchenry/codegraph
-
A `../` entry in package.json `workspaces` makes a folder outside the project count as a workspace package, and a call gets linked to the wrong functionPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
colbymchenry/codegraph#3093 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
colbymchenry/codegraph#2974 ·
Los mantenedores suelen responder en 1 día
-
[Security Vulnerabiliy] Vulnerable bundled `node.exe` detected (Node2Shell - CVE-2026-111497)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
colbymchenry/codegraph#2959 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
codegraph ui - does not workAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
colbymchenry/codegraph#1900 · 2 comentarios · 5 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
colbymchenry/codegraph#1700 ·
Los mantenedores suelen responder en 1 día
Todos los issues de colbymchenry/codegraph
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
elf_loader: Xtensa ignores the addend of R_XTENSA_GLOB_DAT / R_XTENSA_JMP_SLOT (C++ vtables)Posiblemente ocupada @diplfranzhoepfinger la tomó hoy. Abiertoelf_loader
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
espressif/esp-iot-solution#813 ·
Los mantenedores suelen responder en 1 día
-
Status: Opened Type: Bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día