Skip to content

Commit a7fc585

Browse files
committed
Exit child processes on windows
1 parent eee081e commit a7fc585

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/mcp/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ export class MCPServer {
8888
// Keep the process running
8989
process.on('SIGINT', () => this.stop());
9090
process.on('SIGTERM', () => this.stop());
91+
92+
// When the parent process (Claude Code) exits, stdin closes.
93+
// Detect this and shut down gracefully to prevent orphaned processes.
94+
process.stdin.on('end', () => this.stop());
95+
process.stdin.on('close', () => this.stop());
9196
}
9297

9398
/**

0 commit comments

Comments
 (0)