Problem
When using the bundled mcp-debugger CLI to debug the repository's dist/index.js, the target exits successfully without starting its HTTP server. This makes self-debugging appear to run to completion even though the expected server was never started.
Reproduction and observations
- Build mcp-debugger and run the bundled
packages/mcp-debugger/dist/cli.mjs through the development proxy.
- Create a JavaScript debug session and launch the repository's
dist/index.js with args: ['http', '-p', '<free port>'] and stopOnEntry: false.
- The launch reports
state: 'stopped', exit code 0, and that the program ran to completion. The target HTTP endpoint never becomes available.
Observed on Windows / Node v24.14.1, mcp-debugger main f8d55f4493ebfc4253475cf4fc4a2faf4b90a55d, while dogfooding a locally built js-debug adapter. An isolated control with MCP_EXIT_ON_STDIN_CLOSE: '0' and DEBUG_MCP_SKIP_AUTO_START: '1' reproduces the same immediate successful exit. With both flags set to '0', the target starts, serves HTTP, and can be paused, inspected, stepped, and resumed.
Cause
packages/mcp-debugger/src/cli-entry.ts sets process.env.DEBUG_MCP_SKIP_AUTO_START = '1' before importing the source entry point and explicitly invoking main().
JavaScript launch inherits the server environment. In the debuggee, src/index.ts checks that inherited flag and skips its own main() entirely.
Expected
The bundled CLI's internal bootstrap flag should not suppress startup in subsequently launched debuggees. Avoid leaving bootstrap-only state in the inherited environment, or explicitly scope that state to the server's own initialization.
Tested workaround
Pass this in start_debugging.dapLaunchArgs.env when debugging an independent mcp-debugger server:
{
"DEBUG_MCP_SKIP_AUTO_START": "0",
"MCP_EXIT_ON_STDIN_CLOSE": "0"
}
The second flag opts the target out of the development proxy's parent-stdin supervision policy; the first is the startup-suppression defect isolated above. Add regression coverage for launching a second mcp-debugger process from the bundled CLI.
Problem
When using the bundled mcp-debugger CLI to debug the repository's
dist/index.js, the target exits successfully without starting its HTTP server. This makes self-debugging appear to run to completion even though the expected server was never started.Reproduction and observations
packages/mcp-debugger/dist/cli.mjsthrough the development proxy.dist/index.jswithargs: ['http', '-p', '<free port>']andstopOnEntry: false.state: 'stopped', exit code 0, and that the program ran to completion. The target HTTP endpoint never becomes available.Observed on Windows / Node v24.14.1, mcp-debugger main
f8d55f4493ebfc4253475cf4fc4a2faf4b90a55d, while dogfooding a locally built js-debug adapter. An isolated control withMCP_EXIT_ON_STDIN_CLOSE: '0'andDEBUG_MCP_SKIP_AUTO_START: '1'reproduces the same immediate successful exit. With both flags set to'0', the target starts, serves HTTP, and can be paused, inspected, stepped, and resumed.Cause
packages/mcp-debugger/src/cli-entry.tssetsprocess.env.DEBUG_MCP_SKIP_AUTO_START = '1'before importing the source entry point and explicitly invokingmain().JavaScript launch inherits the server environment. In the debuggee,
src/index.tschecks that inherited flag and skips its ownmain()entirely.Expected
The bundled CLI's internal bootstrap flag should not suppress startup in subsequently launched debuggees. Avoid leaving bootstrap-only state in the inherited environment, or explicitly scope that state to the server's own initialization.
Tested workaround
Pass this in
start_debugging.dapLaunchArgs.envwhen debugging an independent mcp-debugger server:{ "DEBUG_MCP_SKIP_AUTO_START": "0", "MCP_EXIT_ON_STDIN_CLOSE": "0" }The second flag opts the target out of the development proxy's parent-stdin supervision policy; the first is the startup-suppression defect isolated above. Add regression coverage for launching a second mcp-debugger process from the bundled CLI.