Describe the bug
When connecting to a sdio MCP server on Windows, a warning is printed during the final cleanup. This does not crash the program but indicates that there might be a need for a more graceful shutdown of subprocess transports.
To Reproduce
Run the following script:
importasynciofrommcpimportClientSession, StdioServerParameters, stdio_clientasyncdefmain():
server_params=StdioServerParameters(
command="npx", args=["-y", "@playwright/mcp@latest"]
) # Or any other serverasyncwithstdio_client(server_params) as (read, write):
asyncwithClientSession(read, write) assession:
awaitsession.initialize()
print(awaitsession.list_tools())
awaitasyncio.sleep(2.0)
if__name__=="__main__":
asyncio.run(main())
Running the above, we get a bunch of warnings and error messages at the end:
Exception ignored in: <function BaseSubprocessTransport.__del__ at 0x...>
Traceback (most recent call last):
...
ValueError: I/O operation on closed pipe
Expected behavior
No warnings or errors should be printed during final cleanup. All subprocess transports and associated resources should be closed cleanly without attempting operations on closed pipes.
Desktop:
- OS: Windows 10
- Version: Python 3.11 (mcp v1.6.0)
Describe the bug
When connecting to a sdio MCP server on Windows, a warning is printed during the final cleanup. This does not crash the program but indicates that there might be a need for a more graceful shutdown of subprocess transports.
To Reproduce
Run the following script:
Running the above, we get a bunch of warnings and error messages at the end:
Expected behavior
No warnings or errors should be printed during final cleanup. All subprocess transports and associated resources should be closed cleanly without attempting operations on closed pipes.
Desktop: