-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix Windows subprocess NotImplementedError (STDIO clients) #596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix Windows subprocess NotImplementedError (STDIO clients) #596
Conversation
…ack to subprocess.Popen
Hi team! This is my first pull request. PR fixes Windows compatibility for MCP STDIO clients by introducing a fallback to subprocess.Popen wrapped with async I/O streams. It ensures that Windows users can now use streamlit and similar STDIO clients without errors. Please let me know if you'd like any further changes. Thank you for your time and for maintaining such an awesome project! Regards |
@dsp-ant @jerome3o-anthropic would appreciate any kind of feedback on this if possible from your end. Thanks a ton! Regards |
Fix subprocess creation errors on Windows for STDIO client connections.
This updates
create_windows_process
to properly handle the case where asyncio cannot create subprocess transports on Windows by falling back to using thesubprocess
module manually.Additionally, minor import sorting and style issues have been fixed according to
ruff
linter checks.Motivation and Context
On Windows systems, MCP clients that connect via STDIO were failing with a
NotImplementedError
duringanyio.open_process()
. This is becauseasyncio
on Windows does not implement full support for subprocess transports.This change provides a clean workaround:
subprocess.Popen
withasyncio
wrapping.This allows MCP STDIO clients (e.g., streamlit_client_ui.py) to work successfully on Windows without changing user workflows.
How Has This Been Tested?
streamlit_client_ui.py
to launch the MCP client.ruff
orpyright
issues for the updated file.Breaking Changes
No breaking changes.
Types of changes
Checklist
Additional context
This fix is especially important for making MCP tools and agents accessible on all platforms, including Windows, thereby helping broader adoption.