From 1a3295ce37a3df3b020c81f6ea804d73084c07b8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 8 Nov 2026 05:51:13 +0000 Subject: [PATCH 1/2] Initial plan From c2d49dcc4613fc6fdf8917da21609c7cbd2e5679 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 8 Nov 2026 05:55:11 +0000 Subject: [PATCH 2/2] Avoid forced exit after normal MCP serve shutdown Co-authored-by: Ramachandrajoshi <14068607+Ramachandrajoshi@users.noreply.github.com> --- src/cli/commands/serve.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cli/commands/serve.js b/src/cli/commands/serve.js index 5b1d899..2a69523 100644 --- a/src/cli/commands/serve.js +++ b/src/cli/commands/serve.js @@ -34,16 +34,19 @@ export async function run(args) { `[cgraph] serving ${ctx.config.root} (${ctx.store.stats().nodes} symbols)\n` ); - const shutdown = () => { + const cleanup = () => { try { ctx.refresher?.dispose(); } catch { /* never loaded */ } try { ctx.store.close(); } catch { /* already closed */ } + }; + const shutdown = () => { + cleanup(); process.exit(0); }; process.on('SIGINT', shutdown); process.on('SIGTERM', shutdown); await ctx.server.start(); - shutdown(); + cleanup(); } function help() {