Skip to content

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

Open
Ashutosh0x wants to merge 2 commits intomodelcontextprotocol:mainfrom
Ashutosh0x:fix/156-jupyter-stderr
Open

fix: explicit stderr piping for Jupyter support (#156)#2030
Ashutosh0x wants to merge 2 commits intomodelcontextprotocol:mainfrom
Ashutosh0x:fix/156-jupyter-stderr

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