Skip to content

fix: forward stdio server stderr through errlog - #2915

Closed
jordansilly77-stack wants to merge 1 commit into
modelcontextprotocol:mainfrom
jordansilly77-stack:codex/fix-jupyter-stdio-stderr
Closed

fix: forward stdio server stderr through errlog#2915
jordansilly77-stack wants to merge 1 commit into
modelcontextprotocol:mainfrom
jordansilly77-stack:codex/fix-jupyter-stdio-stderr

Conversation

@jordansilly77-stack

Copy link
Copy Markdown

Summary

  • pipe stdio server stderr on POSIX instead of handing the current sys.stderr object directly to the subprocess
  • forward stderr chunks through the existing errlog stream
  • close the stderr pipe during shutdown and add a regression test for errlog forwarding

Fixes #156.

Testing

  • python3 -m py_compile src/mcp/client/stdio.py tests/client/test_stdio.py
  • uv run ruff check src/mcp/client/stdio.py tests/client/test_stdio.py
  • uv run ruff format src/mcp/client/stdio.py tests/client/test_stdio.py --check

I could not complete the local pytest run on this Mac because the repository virtualenv hits local plugin/import issues, including macOS blocking black's compiled extension and slow logfire/pydantic plugin imports. The focused code and formatting checks above pass; CI should provide the full pytest signal.

AI disclosure

AI assistance was used to research the issue context, draft the patch, and run local checks. The final changes were reviewed before submission.

@jordansilly77-stack
jordansilly77-stack force-pushed the codex/fix-jupyter-stdio-stderr branch 5 times, most recently from 8b9f833 to 8dda36f Compare June 20, 2026 05:25
@maxisbey

Copy link
Copy Markdown
Contributor

Thanks for the PR. Tracking this in #3268 instead. Closing this as part of a wider backlog cleanup following the v2 launch. Feel free to reopen if this is still relevant.

AI Disclaimer

@maxisbey maxisbey closed this Aug 11, 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.

support logging to stderr in Jupyter Notebook Environments.

2 participants