Skip to content

Commit 265d724

Browse files
committed
fix: attempt to terminate process gracefully
1 parent 568cbd1 commit 265d724

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/mcp/client/stdio.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,7 @@ async def stdin_writer():
159159
):
160160
tg.start_soon(stdout_reader)
161161
tg.start_soon(stdin_writer)
162-
yield read_stream, write_stream
162+
try:
163+
yield read_stream, write_stream
164+
finally:
165+
process.terminate()

0 commit comments

Comments
 (0)