Skip to content

Commit 25498aa

Browse files
committed
readd aclose
1 parent cc1f544 commit 25498aa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/mcp/client/stdio/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@ async def stdin_writer():
167167
tg.start_soon(stdin_writer)
168168

169169
try:
170-
async with read_stream, write_stream:
171-
yield read_stream, write_stream
170+
yield read_stream, write_stream
172171
finally:
173172
# MCP spec: stdio shutdown sequence
174173
# 1. Close input stream to server
@@ -194,6 +193,8 @@ async def stdin_writer():
194193
pass
195194
await read_stream_writer.aclose()
196195
await write_stream_reader.aclose()
196+
await read_stream.aclose()
197+
await write_stream.aclose()
197198

198199

199200
def _get_executable_command(command: str) -> str:

0 commit comments

Comments
 (0)