René's URL Explorer Experiment


Title: Issue · GitHub

Open Graph Title: Issue · modelcontextprotocol/python-sdk

X Title: Issue · modelcontextprotocol/python-sdk

Description: The official Python SDK for Model Context Protocol servers and clients - Issue · modelcontextprotocol/python-sdk

Open Graph Description: The official Python SDK for Model Context Protocol servers and clients - Issue · modelcontextprotocol/python-sdk

X Description: The official Python SDK for Model Context Protocol servers and clients - Issue · modelcontextprotocol/python-sdk

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"support logging to stderr in Jupyter Notebook Environments.","articleBody":"**Is your feature request related to a problem? Please describe.**\nI want to make mcp python-sdk jupyter notebook compatible. When running in a notebook environment, MCP work but do not output stderr as it does normally.\n\nFor instance in jupyter notebook:\n\n```python\nimport mcp\nimport os\nfrom mcp.client.stdio import stdio_client\n\nserverparams = mcp.StdioServerParameters(\n    command=\"uv\",\n    args=[\"--quiet\", \"run\", \"../src/echo.py\"],\n    env={\"UV_PYTHON\": \"3.12\", **os.environ},\n)\n\nasync with stdio_client(serverparams) as (read, write):\n    async with mcp.ClientSession(read, write) as session:\n        await session.initialize()\n        tools = await session.list_tools()\n        print(tools)\n```\nOutputs:\n```\nmeta=None nextCursor=None tools=[Tool(name='echo_tool', description='Echo the input text\\n\\n    Args:\\n        text (str): The text to echo\\n\\n    Returns:\\n        str: The echoed text\\n    ', inputSchema={'properties': {'text': {'title': 'Text', 'type': 'string'}}, 'required': ['text'], 'title': 'echo_toolArguments', 'type': 'object'})]\n```\n\nwhile running the server without jupyter notebook:\n\n```bash\n❯ uv run --quiet src/echo.py\nstarting echo server\n```\n\nstderr is correctly displayed.\n\nThis is a big problem mostly because if the server is crashing or the command is wrong you have no way to know what's wrong: nothing is logged and the jupyter notebook cell just hangs.\n\n**Describe the solution you'd like**\nI found the culprit being the use of:\n\n```python \nprocess = await anyio.open_process(\n        [server.command, *server.args],\n        env=server.env if server.env is not None else get_default_environment(),\n        stderr=sys.stderr,\n )\n```\nIn particular sys.stderr here is not working in the jupyter / ipython context. Instead I would suggest a working change as follow:\n\n1. remove the stderr params from the process and handle process.stderr in an async function as stdout / stdin is handled.\n2. to that effect, use a `stderr_reader` async function  like the following:\n\n```python\n    async def stderr_reader():\n        assert process.stderr, \"Opened process is missing stderr\"\n        try:\n            async for line in process.stderr:\n                if is_jupyter_notebook():\n                    print(f\"\\033[91m {line.decode().strip()}\")\n                else:\n                    # redirect to stderr as before\n                    print(line.decode().strip(), file=sys.stderr)\n        except anyio.ClosedResourceError:\n            await anyio.lowlevel.checkpoint()\n```\n\nThis would result in the same behavior as before while allowing the stderr to be logged in the jupyter notebook context.\n\n**Additional context**\nJupyter notebook support support is also requested for mcpadapt which bring MCP server tools in any agentic framework, as many agentic framework demonstrate usage in jupyter notebooks.\nhttps://github.com/grll/mcpadapt \n","author":{"url":"https://github.com/grll","@type":"Person","name":"grll"},"datePublished":"2025-01-17T09:09:24.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/156/python-sdk/issues/156"}

route-pattern/:user_id/:repository/issues/:id(.:format)
route-controllerissues
route-actionshow
fetch-noncev2:98e90535-99c6-7602-601c-e92e9bd2b272
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id868C:242DFD:8B64C8:C87206:6A58C728
html-safe-nonce2a182316012bd40178e6e1ac8f25f7043baf51d13431aebcd2b1dcd3871aaba7
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NjhDOjI0MkRGRDo4QjY0Qzg6Qzg3MjA2OjZBNThDNzI4IiwidmlzaXRvcl9pZCI6IjY4MDczMjYyNzE3NTg0NTI1MjAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac0d7a2b4b9aad0e172291eb7db14d946bc807b13584bbbf548ad6289e0fe0e645
hovercard-subject-tagrepository:862584018
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///issues/show
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/issues/156
twitter:imagehttps://opengraph.githubassets.com/843d1c8b211f1178ef432e19b617ca5096e04778dbb0df08903a2f377b3f3d34/modelcontextprotocol/python-sdk
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/843d1c8b211f1178ef432e19b617ca5096e04778dbb0df08903a2f377b3f3d34/modelcontextprotocol/python-sdk
og:image:altThe official Python SDK for Model Context Protocol servers and clients - Issue · modelcontextprotocol/python-sdk
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None5f2a0c7865178af3d91dd9f13b0cdfc3c73a2529c873d2780bb4c01271a57ec6
turbo-cache-controlno-cache
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8aae7b8d6caacacf5c66eaeb2702d8dc88d85b4a
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/issues/156#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F156
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%2Fissues%2F156
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%2Fissues%2Fshow&source=header-repo&source_repo=modelcontextprotocol%2Fpython-sdk
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/156
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/156
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/156
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/issues/156
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 254 https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests 290 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
#2915https://github.com/modelcontextprotocol/python-sdk/pull/2915
#2020https://github.com/modelcontextprotocol/python-sdk/pull/2020
support logging to stderr in Jupyter Notebook Environments.https://github.com/modelcontextprotocol/python-sdk/issues/156#top
#2915https://github.com/modelcontextprotocol/python-sdk/pull/2915
#2020https://github.com/modelcontextprotocol/python-sdk/pull/2020
P3Nice to haves, rare edge caseshttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22P3%22
bugSomething isn't workinghttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%22
good first issueGood for newcomershttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22good%20first%20issue%22
ready for workEnough information for someone to start working onhttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22ready%20for%20work%22
SDK 1.2.xhttps://github.com/modelcontextprotocol/python-sdk/milestone/4
https://github.com/grll
grllhttps://github.com/grll
on Jan 17, 2025https://github.com/modelcontextprotocol/python-sdk/issues/156#issue-2794939918
https://github.com/grll/mcpadapthttps://github.com/grll/mcpadapt
P3Nice to haves, rare edge caseshttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22P3%22
bugSomething isn't workinghttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%22
good first issueGood for newcomershttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22good%20first%20issue%22
ready for workEnough information for someone to start working onhttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22ready%20for%20work%22
SDK 1.2.xhttps://github.com/modelcontextprotocol/python-sdk/milestone/4
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.