diff --git a/src/client/stdio.ts b/src/client/stdio.ts index b83bf27c..8352843e 100644 --- a/src/client/stdio.ts +++ b/src/client/stdio.ts @@ -187,7 +187,14 @@ export class StdioClientTransport implements Transport { async close(): Promise { this._abortController.abort(); - this._process = undefined; + if (this._process) { + try { + this._process.kill(); + } catch (e) { + // Optionally log or ignore + } + this._process = undefined; + } this._readBuffer.clear(); }