Skip to content

fix: make Windows stdio pywin32 optional#2365

Open
raashish1601 wants to merge 2 commits intomodelcontextprotocol:mainfrom
raashish1601:contributor-15/python-sdk-2233
Open

fix: make Windows stdio pywin32 optional#2365
raashish1601 wants to merge 2 commits intomodelcontextprotocol:mainfrom
raashish1601:contributor-15/python-sdk-2233

Conversation

@raashish1601
Copy link
Copy Markdown

Summary

  • stop importing client stdio modules eagerly from mcp.init
  • make pywin32 optional via a new stdio extra while keeping the dev/test dependency group on that extra
  • add import regressions plus installation notes for Windows server-only installs

Fixes #2233.

Testing

  • python -m uv run pytest tests/issues/test_2233_windows_stdio_imports.py tests/server/test_stdio.py tests/issues/test_1027_win_unreachable_cleanup.py tests/client/test_session_group.py -q
  • fresh base install in a throwaway Windows venv: python -m uv pip install -e . followed by rom mcp.server.stdio import stdio_server, with pywin32 absent from that environment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pywin32 installation fails on Windows — hard dep only needed for client stdio, but pulled in for all users via eager import in __init__.py

1 participant