We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 84860f8 + 3e0c70c commit 04324e9Copy full SHA for 04324e9
src/mcp/client/stdio/__init__.py
@@ -162,6 +162,11 @@ async def stdout_reader():
162
await read_stream_writer.send(session_message)
163
except anyio.ClosedResourceError:
164
await anyio.lowlevel.checkpoint()
165
+ except (BrokenPipeError, ConnectionResetError):
166
+ # The server process exited and closed its stdin. Treat this as a normal
167
+ # shutdown so the caller sees the connection close rather than an
168
+ # unhandled exception from the background task.
169
+ await anyio.lowlevel.checkpoint()
170
171
async def stdin_writer():
172
assert process.stdin, "Opened process is missing stdin"
0 commit comments