MCPcopy
hub / github.com/colbymchenry/codegraph / stop

Method stop

src/mcp/index.ts:265–290  ·  view source on GitHub ↗

* Stop the server. In daemon mode this triggers graceful shutdown of every * connected session; in direct mode it mirrors the pre-#411 behavior (close * cg, exit). Proxy mode never routes through here — the proxy exits itself.

()

Source from the content-addressed store, hash-verified

263 * cg, exit). Proxy mode never routes through here — the proxy exits itself.
264 */
265 stop(): void {
266 if (this.stopped) return;
267 this.stopped = true;
268 if (this.ppidWatchdog) {
269 clearInterval(this.ppidWatchdog);
270 this.ppidWatchdog = null;
271 }
272 if (this.livenessWatchdog) {
273 this.livenessWatchdog.stop();
274 this.livenessWatchdog = null;
275 }
276 if (this.daemon) {
277 void this.daemon.stop('stop()');
278 // Daemon.stop calls process.exit; nothing else to do.
279 return;
280 }
281 if (this.session) {
282 this.session.stop();
283 this.session = null;
284 }
285 if (this.engine) {
286 this.engine.stop();
287 this.engine = null;
288 }
289 process.exit(0);
290 }
291
292 /** Single-process stdio MCP session — the pre-issue-#411 code path. */
293 private async startDirect(reason: string): Promise<void> {

Callers 3

startDirectMethod · 0.95
installSignalHandlersMethod · 0.95
installPpidWatchdogMethod · 0.95

Calls 1

stopMethod · 0.65

Tested by

no test coverage detected