Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#3,054 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
86/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript, node.js
領域
cli, tooling

調査の方向性

まず npm-shim.js を読み、shim と extract() 内の spawnSync 呼び出しを見つけてください。Windows で、非表示の親プロセスから codegraph.cmd serve --mcp を起動して確認してください。どちらの起動経路でもコンソールが一瞬も表示されず、stdio MCP サーバーが引き続き正常に起動すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
C
スター
73.2k
フォーク
4.7k
平均マージ
3時間 31分
マージ済み PR(30日)
546

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

colbymchenry/codegraph のほかの issue

colbymchenry/codegraph の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。