Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Comments

Close side panel

fix: explicit stderr piping for Jupyter support (#156)#2030

Open
Ashutosh0x wants to merge 2 commits intomodelcontextprotocol:mainmodelcontextprotocol/python-sdk:mainfrom
Ashutosh0x:fix/156-jupyter-stderrAshutosh0x/python-sdk:fix/156-jupyter-stderrCopy head branch name to clipboard
Open

fix: explicit stderr piping for Jupyter support (#156)#2030
Ashutosh0x wants to merge 2 commits intomodelcontextprotocol:mainmodelcontextprotocol/python-sdk:mainfrom
Ashutosh0x:fix/156-jupyter-stderrAshutosh0x/python-sdk:fix/156-jupyter-stderrCopy head branch name to clipboard

Conversation

@Ashutosh0x
Copy link

In Jupyter environments, stderr from subprocesses isn't directly visible. To fix this, we pipe stderr via subprocess.PIPE and use a background reader task that detects Jupyter (via is_jupyter()) and prints the output with ANSI red coloring. For standard environments, the output is routed to errlog as before.

Also updated create_windows_process to accept int for errlog, allowing subprocess.PIPE.

Closes #156

…elcontextprotocol#156)

In Jupyter environments, stderr from subprocesses isn't directly visible.
To fix this, we pipe stderr via subprocess.PIPE and use a background reader
task that detects Jupyter (via is_jupyter()) and prints the output with
ANSI red coloring. For standard environments, the output is routed to
sys.stderr as before.

Also updated create_windows_process to accept int for errlog, allowing
subprocess.PIPE.

Closes modelcontextprotocol#156
@Ashutosh0x Ashutosh0x mentioned this pull request Feb 10, 2026
@maxisbey
Copy link
Contributor

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.