René's URL Explorer Experiment


Title: feat: support logging to stderr in Jupyter Notebook environments (#156) by dgenio · Pull Request #1707 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: feat: support logging to stderr in Jupyter Notebook environments (#156) by dgenio · Pull Request #1707 · modelcontextprotocol/python-sdk

X Title: feat: support logging to stderr in Jupyter Notebook environments (#156) by dgenio · Pull Request #1707 · modelcontextprotocol/python-sdk

Description: Summary Fixes #156 - Adds support for displaying stderr output in Jupyter Notebook environments. Changes Added Jupyter/IPython detection using IPython.get_ipython() Implemented async stderr reader that reads stderr asynchronously (similar to stdout) Added IPython display integration for colored stderr output in Jupyter notebooks Updated process creation to pipe stderr instead of redirecting (enables async reading) Updated Windows process creation and fallback to support piped stderr Updated FallbackProcess to wrap stderr in async-compatible streams Design Decisions Backward compatibility: errlog parameter is kept but behavior adapts based on environment Error handling: Non-critical errors are logged but don't stop execution Performance: Matches stdout_reader behavior (line-by-line buffering) Platform support: Works on both Unix and Windows (including fallback path) Testing Added comprehensive tests for stderr capture, Jupyter detection, and display integration All existing tests pass Linting and type checking pass Behavior In Jupyter: stderr is displayed using IPython's display system with red HTML formatting Outside Jupyter: stderr is printed to the provided errlog stream (defaults to sys.stderr) Fallback: If IPython display fails, falls back to regular print This enables proper debugging of MCP servers in Jupyter notebook environments, addressing the issue where server crashes or command errors were invisible.

Open Graph Description: Summary Fixes #156 - Adds support for displaying stderr output in Jupyter Notebook environments. Changes Added Jupyter/IPython detection using IPython.get_ipython() Implemented async stderr reader...

X Description: Summary Fixes #156 - Adds support for displaying stderr output in Jupyter Notebook environments. Changes Added Jupyter/IPython detection using IPython.get_ipython() Implemented async stderr reader...

Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/1707

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:88ebf2e9-e35c-c4ad-d189-1b443e278575
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBF3C:C57C7:8977D9:BA0244:6A5A85E7
html-safe-noncedfe2e913441d6b77605392af92970f9f917d6e8b72848fcc35a5d2ea2f0eba1f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjNDOkM1N0M3Ojg5NzdEOTpCQTAyNDQ6NkE1QTg1RTciLCJ2aXNpdG9yX2lkIjoiNTA3NjY2ODQ1MjUxMTA1NzM4MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac96acd7f569407be4568bbbadf413fb9685171404fc314b8956d12d902b0c4db8
hovercard-subject-tagpull_request:3056203239
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/1707/files
twitter:imagehttps://avatars.githubusercontent.com/u/12731907?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/12731907?s=400&v=4
og:image:altSummary Fixes #156 - Adds support for displaying stderr output in Jupyter Notebook environments. Changes Added Jupyter/IPython detection using IPython.get_ipython() Implemented async stderr reader...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None922bdba685ea48400234d557977f0e32d9adbae6f5125725b4f48cacc6801106
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git
octolytics-dimension-user_id182288589
octolytics-dimension-user_loginmodelcontextprotocol
octolytics-dimension-repository_id862584018
octolytics-dimension-repository_nwomodelcontextprotocol/python-sdk
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id862584018
octolytics-dimension-repository_network_root_nwomodelcontextprotocol/python-sdk
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7c8a44665d760d73ead7e85d8f88b299152aa681
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/pull/1707/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F1707%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F1707%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=modelcontextprotocol%2Fpython-sdk
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/1707/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/1707/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/1707/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1707/files
modelcontextprotocol https://github.com/modelcontextprotocol
python-sdkhttps://github.com/modelcontextprotocol/python-sdk
Notifications https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Fork 3.7k https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Star 23.6k https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Code https://github.com/modelcontextprotocol/python-sdk
Issues 256 https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests 303 https://github.com/modelcontextprotocol/python-sdk/pulls
Actions https://github.com/modelcontextprotocol/python-sdk/actions
Projects https://github.com/modelcontextprotocol/python-sdk/projects
Models https://github.com/modelcontextprotocol/python-sdk/models
Security and quality 6 https://github.com/modelcontextprotocol/python-sdk/security
Insights https://github.com/modelcontextprotocol/python-sdk/pulse
Code https://github.com/modelcontextprotocol/python-sdk
Issues https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests https://github.com/modelcontextprotocol/python-sdk/pulls
Actions https://github.com/modelcontextprotocol/python-sdk/actions
Projects https://github.com/modelcontextprotocol/python-sdk/projects
Models https://github.com/modelcontextprotocol/python-sdk/models
Security and quality https://github.com/modelcontextprotocol/python-sdk/security
Insights https://github.com/modelcontextprotocol/python-sdk/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2Fnew%2Fchoose
dgeniohttps://github.com/dgenio
modelcontextprotocol:mainhttps://github.com/modelcontextprotocol/python-sdk/tree/main
dgenio:feature/156-jupyter-stderr-cleanhttps://github.com/dgenio/python-sdk/tree/feature/156-jupyter-stderr-clean
Conversation 2 https://github.com/modelcontextprotocol/python-sdk/pull/1707
Commits 3 https://github.com/modelcontextprotocol/python-sdk/pull/1707/commits
Checks 18 https://github.com/modelcontextprotocol/python-sdk/pull/1707/checks
Files changed https://github.com/modelcontextprotocol/python-sdk/pull/1707/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1707/files
feat: support logging to stderr in Jupyter Notebook environments (#156) https://github.com/modelcontextprotocol/python-sdk/pull/1707/files#top
Show all changes 3 commits https://github.com/modelcontextprotocol/python-sdk/pull/1707/files
69ff03b feat: add Jupyter notebook stderr support to stdio_client dgenio Nov 30, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1707/commits/69ff03b7341adee6c88b9835ee34e4a208ba474c
4e6bda4 test: add comprehensive tests for Jupyter stderr support dgenio Nov 30, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1707/commits/4e6bda438872135b0f76ff03cbc3db01703f8266
6a53190 Merge branch 'main' into feature/156-jupyter-stderr-clean dgenio Dec 1, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1707/commits/6a5319014a6ceb8827237c4b17839cace4b84307
Clear filters https://github.com/modelcontextprotocol/python-sdk/pull/1707/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1707/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1707/files
__init__.py https://github.com/modelcontextprotocol/python-sdk/pull/1707/files#diff-2d78210c1f729556ae6d443eb0e255394d786171d32842ff2f8dea90d096da39
utilities.py https://github.com/modelcontextprotocol/python-sdk/pull/1707/files#diff-0adc630bbecb11fd2fe8fc302a21e9afe0ebb9c3ae019a95d9bf84817cf73f61
test_stdio.py https://github.com/modelcontextprotocol/python-sdk/pull/1707/files#diff-49f66b09e4d89b29b440c955c429fe948dbcc3bbb08fffb504cf40be24382352
src/mcp/client/stdio/__init__.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/1707/files#diff-2d78210c1f729556ae6d443eb0e255394d786171d32842ff2f8dea90d096da39
View file https://github.com/dgenio/python-sdk/blob/6a5319014a6ceb8827237c4b17839cace4b84307/src/mcp/client/stdio/__init__.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/1707/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/1707/files#diff-2d78210c1f729556ae6d443eb0e255394d786171d32842ff2f8dea90d096da39
https://github.com/modelcontextprotocol/python-sdk/pull/1707/files#diff-2d78210c1f729556ae6d443eb0e255394d786171d32842ff2f8dea90d096da39
https://github.com/modelcontextprotocol/python-sdk/pull/1707/files#diff-2d78210c1f729556ae6d443eb0e255394d786171d32842ff2f8dea90d096da39
https://github.com/modelcontextprotocol/python-sdk/pull/1707/files#diff-2d78210c1f729556ae6d443eb0e255394d786171d32842ff2f8dea90d096da39
https://github.com/modelcontextprotocol/python-sdk/pull/1707/files#diff-2d78210c1f729556ae6d443eb0e255394d786171d32842ff2f8dea90d096da39
https://github.com/modelcontextprotocol/python-sdk/pull/1707/files#diff-2d78210c1f729556ae6d443eb0e255394d786171d32842ff2f8dea90d096da39
https://github.com/modelcontextprotocol/python-sdk/pull/1707/files#diff-2d78210c1f729556ae6d443eb0e255394d786171d32842ff2f8dea90d096da39
https://github.com/modelcontextprotocol/python-sdk/pull/1707/files#diff-2d78210c1f729556ae6d443eb0e255394d786171d32842ff2f8dea90d096da39
https://github.com/modelcontextprotocol/python-sdk/pull/1707/files#diff-2d78210c1f729556ae6d443eb0e255394d786171d32842ff2f8dea90d096da39
src/mcp/os/win32/utilities.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/1707/files#diff-0adc630bbecb11fd2fe8fc302a21e9afe0ebb9c3ae019a95d9bf84817cf73f61
View file https://github.com/dgenio/python-sdk/blob/6a5319014a6ceb8827237c4b17839cace4b84307/src/mcp/os/win32/utilities.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/1707/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/1707/files#diff-0adc630bbecb11fd2fe8fc302a21e9afe0ebb9c3ae019a95d9bf84817cf73f61
https://github.com/modelcontextprotocol/python-sdk/pull/1707/files#diff-0adc630bbecb11fd2fe8fc302a21e9afe0ebb9c3ae019a95d9bf84817cf73f61
https://github.com/modelcontextprotocol/python-sdk/pull/1707/files#diff-0adc630bbecb11fd2fe8fc302a21e9afe0ebb9c3ae019a95d9bf84817cf73f61
https://github.com/modelcontextprotocol/python-sdk/pull/1707/files#diff-0adc630bbecb11fd2fe8fc302a21e9afe0ebb9c3ae019a95d9bf84817cf73f61
https://github.com/modelcontextprotocol/python-sdk/pull/1707/files#diff-0adc630bbecb11fd2fe8fc302a21e9afe0ebb9c3ae019a95d9bf84817cf73f61
https://github.com/modelcontextprotocol/python-sdk/pull/1707/files#diff-0adc630bbecb11fd2fe8fc302a21e9afe0ebb9c3ae019a95d9bf84817cf73f61
https://github.com/modelcontextprotocol/python-sdk/pull/1707/files#diff-0adc630bbecb11fd2fe8fc302a21e9afe0ebb9c3ae019a95d9bf84817cf73f61
https://github.com/modelcontextprotocol/python-sdk/pull/1707/files#diff-0adc630bbecb11fd2fe8fc302a21e9afe0ebb9c3ae019a95d9bf84817cf73f61
https://github.com/modelcontextprotocol/python-sdk/pull/1707/files#diff-0adc630bbecb11fd2fe8fc302a21e9afe0ebb9c3ae019a95d9bf84817cf73f61
https://github.com/modelcontextprotocol/python-sdk/pull/1707/files#diff-0adc630bbecb11fd2fe8fc302a21e9afe0ebb9c3ae019a95d9bf84817cf73f61
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1707/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1707/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.