fix: allow integer file descriptors for errlog in stdio_client
Fixes #1806
stdio_client() typed errlog as TextIO, preventing callers from passing
integer file descriptors such as subprocess.DEVNULL. The underlying subprocess
calls (anyio.open_process and subprocess.Popen) already accept integers for
stderr — this was a type-annotation gap, not a runtime limitation.
Motivation and Context
Users running CLI tools or embedding MCP servers in larger applications often
want to suppress server stderr entirely. subprocess.DEVNULL is the standard
Python way to do this, but passing it to stdio_client() raised a type error
because errlog was annotated as TextIO only.
How Has This Been Tested?
Type annotation change only — no runtime behaviour changes. The underlying
anyio.open_process and subprocess.Popen calls already accept int for
stderr. All existing tests continue to pass.
Breaking Changes
None. Existing callers using TextIO (e.g. sys.stderr) are unaffected.
Types of changes
- Bug fix (non-breaking change which fixes an issue)
Checklist
- I have read the MCP Documentation
- My code follows the repository's style guidelines
- New and existing tests pass locally
- I have added or updated documentation as needed