Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Windows: npm-shim spawnSync missing windowsHide flashes a console window on every MCP server launch

Abierto Apto para principiantes
#3,054 1 comentario 0 reacciones 0 asignados Ver en GitHub

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
Área
cli, tooling

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/codegraph overwrites 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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de colbymchenry/codegraph

Todos los issues de colbymchenry/codegraph

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.