File tree Expand file tree Collapse file tree 3 files changed +11
-19
lines changed Expand file tree Collapse file tree 3 files changed +11
-19
lines changed Original file line number Diff line number Diff line change @@ -585,15 +585,12 @@ For low level server with Streamable HTTP implementations, see:
585
585
- Stateful server: [ ` examples/servers/simple-streamablehttp/ ` ] ( examples/servers/simple-streamablehttp/ )
586
586
- Stateless server: [ ` examples/servers/simple-streamablehttp-stateless/ ` ] ( examples/servers/simple-streamablehttp-stateless/ )
587
587
588
-
589
-
590
588
The streamable HTTP transport supports:
591
589
- Stateful and stateless operation modes
592
590
- Resumability with event stores
593
- - JSON or SSE response formats
591
+ - JSON or SSE response formats
594
592
- Better scalability for multi-node deployments
595
593
596
-
597
594
### Mounting to an Existing ASGI Server
598
595
599
596
> ** Note** : SSE transport is being superseded by [ Streamable HTTP transport] ( https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http ) .
Original file line number Diff line number Diff line change @@ -179,18 +179,18 @@ async def stdin_writer():
179
179
yield read_stream , write_stream
180
180
finally :
181
181
# Clean up process to prevent any dangling orphaned processes
182
- if sys .platform == "win32" :
183
- await terminate_windows_process (process )
184
- else :
185
- # On Linux, terminating a process that has already exited raises ProcessLookupError.
186
- # This can happen if the command failed to launch properly (as in this test case).
187
- try :
182
+ try :
183
+ if sys .platform == "win32" :
184
+ await terminate_windows_process (process )
185
+ else :
188
186
process .terminate ()
189
- except ProcessLookupError :
190
- # Process already exited — safe to ignore
191
- pass
187
+ except ProcessLookupError :
188
+ # Process already exited, which is fine
189
+ pass
192
190
await read_stream .aclose ()
193
191
await write_stream .aclose ()
192
+ await read_stream_writer .aclose ()
193
+ await write_stream_reader .aclose ()
194
194
195
195
196
196
def _get_executable_command (command : str ) -> str :
Original file line number Diff line number Diff line change @@ -57,12 +57,7 @@ async def test_stdio_client():
57
57
@pytest .mark .anyio
58
58
async def test_stdio_client_bad_path ():
59
59
"""Check that the connection doesn't hang if process errors."""
60
-
61
- # Removed `-c` to simulate a real "file not found" error instead of
62
- # executing a bad inline script.
63
- # This ensures the subprocess fails to launch, which better matches
64
- # the test's intent.
65
- server_params = StdioServerParameters (command = "python" , args = ["non-existent-file.py" ])
60
+ server_params = StdioServerParameters (command = "python" , args = ["-c" , "non-existent-file.py" ])
66
61
async with stdio_client (server_params ) as (read_stream , write_stream ):
67
62
async with ClientSession (read_stream , write_stream ) as session :
68
63
# The session should raise an error when the connection closes
You can’t perform that action at this time.
0 commit comments