Skip to content

fix: make Windows stdio pywin32 optional - #2365

Closed
raashish1601 wants to merge 2 commits into
modelcontextprotocol:mainfrom
raashish1601:contributor-15/python-sdk-2233
Closed

fix: make Windows stdio pywin32 optional#2365
raashish1601 wants to merge 2 commits into
modelcontextprotocol: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

@maxisbey

Copy link
Copy Markdown
Contributor

Thanks for the PR. Per our CONTRIBUTING.md we ask that PRs start from a linked, triaged issue with maintainer buy-in, which this one doesn't have yet. I'm closing this out as part of a backlog cleanup around the v2 release. Feel free to reopen if this is still relevant.

AI Disclaimer

@maxisbey maxisbey closed this Jul 24, 2026
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

2 participants