René's URL Explorer Experiment


Title: Fix: memory leak and exit problems by PWZER · Pull Request #586 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: Fix: memory leak and exit problems by PWZER · Pull Request #586 · modelcontextprotocol/python-sdk

X Title: Fix: memory leak and exit problems by PWZER · Pull Request #586 · modelcontextprotocol/python-sdk

Description: The official Python SDK for Model Context Protocol servers and clients - Fix: memory leak and exit problems by PWZER · Pull Request #586 · modelcontextprotocol/python-sdk

Open Graph Description: Motivation and Context Here handle_sse calls app.run() every time it processes a sse request, but app.run() keeps running and does not stop automatically, which causes handle_sse to never end, an...

X Description: Motivation and Context Here handle_sse calls app.run() every time it processes a sse request, but app.run() keeps running and does not stop automatically, which causes handle_sse to never end, an...

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

X: @github

direct link

Domain: github.com

route-pattern/_view_fragments/voltron/pull_requests/show/:user_id/:repository/:id/pull_request_layout(.:format)
route-controllervoltron_pull_requests_fragments
route-actionpull_request_layout
fetch-noncev2:d0e32379-3ab1-252e-2602-4e4a85df170f
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id995E:391B0E:1BA56CC:26785F2:6A5F3AA3
html-safe-nonce811cbdfc82547b688ccea5f8b50d2bc811af0bcbeed4a4857d4a2200dc1512c9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTVFOjM5MUIwRToxQkE1NkNDOjI2Nzg1RjI6NkE1RjNBQTMiLCJ2aXNpdG9yX2lkIjoiMTA3ODI4NzE2MzkwNDE3ODg1MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac8083368ab3e98fe27144825e14a56c3ab475a0874f9df9e05969de92d207fa45
hovercard-subject-tagpull_request:2480499504
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///voltron/pull_requests_fragments/pull_request_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/voltron/pull_requests/show/modelcontextprotocol/python-sdk/586/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/fbd17ee0fccc254206f8ff5833610cbc3c80b0af4ac43b4da8873ab289303caa/modelcontextprotocol/python-sdk/pull/586
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/fbd17ee0fccc254206f8ff5833610cbc3c80b0af4ac43b4da8873ab289303caa/modelcontextprotocol/python-sdk/pull/586
og:image:altMotivation and Context Here handle_sse calls app.run() every time it processes a sse request, but app.run() keeps running and does not stop automatically, which causes handle_sse to never end, an...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamePWZER
hostnamegithub.com
expected-hostnamegithub.com
Noneab2497d9345a59709926b385d88458fa5932c82ec066288448eb68b34cbcbbda
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
releaseba0ac57287507693938b0a2de45402a22cda0785
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/pull/586#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F586
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
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
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%2F586
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%2Fvoltron%2Fpull_requests_fragments%2Fpull_request_layout&source=header-repo&source_repo=modelcontextprotocol%2Fpython-sdk
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/586
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/586
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/586
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/586
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.7k https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Code https://github.com/modelcontextprotocol/python-sdk
Issues 264 https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests 310 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
PWZERhttps://github.com/PWZER
modelcontextprotocol:mainhttps://github.com/modelcontextprotocol/python-sdk/tree/main
PWZER:mainhttps://github.com/PWZER/python-sdk/tree/main
Conversationhttps://github.com/modelcontextprotocol/python-sdk/pull/586
Commits5 (5)https://github.com/modelcontextprotocol/python-sdk/pull/586/commits
Checkshttps://github.com/modelcontextprotocol/python-sdk/pull/586/checks
Files changedhttps://github.com/modelcontextprotocol/python-sdk/pull/586/files
Fix: memory leak and exit problemshttps://github.com/modelcontextprotocol/python-sdk/pull/586#top
PWZERhttps://github.com/PWZER
modelcontextprotocol:mainhttps://github.com/modelcontextprotocol/python-sdk/tree/main
PWZER:mainhttps://github.com/PWZER/python-sdk/tree/main
https://github.com/PWZER
PWZERhttps://github.com/PWZER
Apr 25, 2025https://github.com/modelcontextprotocol/python-sdk/pull/586#issue-3018819380
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/586
python-sdk/examples/servers/simple-tool/mcp_simple_tool/server.pyhttps://github.com/modelcontextprotocol/python-sdk/blob/b4c7db6a50a5c88bae1db5c1f7fba44d16eebc6e/examples/servers/simple-tool/mcp_simple_tool/server.py#L67-L73
b4c7db6https://github.com/modelcontextprotocol/python-sdk/commit/b4c7db6a50a5c88bae1db5c1f7fba44d16eebc6e
issues#541https://github.com/modelcontextprotocol/python-sdk/issues/514#issue-2994309207
MCP Documentationhttps://modelcontextprotocol.io
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/586
PWZERhttps://github.com/PWZER
April 24, 2025 19:08https://github.com/modelcontextprotocol/python-sdk/pull/586#commits-pushed-dfa7c6a
https://github.com/PWZER
Fix: SseServerTransport.handle_sse never ends and can lead to memory …https://github.com/modelcontextprotocol/python-sdk/pull/586/commits/dfa7c6ac3e43903fb80d219e04194748871e6c44
dfa7c6ahttps://github.com/modelcontextprotocol/python-sdk/pull/586/commits/dfa7c6ac3e43903fb80d219e04194748871e6c44
https://github.com/PWZER
update exampleshttps://github.com/modelcontextprotocol/python-sdk/pull/586/commits/1917066e4daa03ddbb383a99e94d0c51a81d6626
1917066https://github.com/modelcontextprotocol/python-sdk/pull/586/commits/1917066e4daa03ddbb383a99e94d0c51a81d6626
https://github.com/PWZER
PWZERhttps://github.com/PWZER
force-pushedhttps://github.com/modelcontextprotocol/python-sdk/compare/e0f195f099e206efd3d17a9c9467b169715a3987..1917066e4daa03ddbb383a99e94d0c51a81d6626
e0f195fhttps://github.com/modelcontextprotocol/python-sdk/commit/e0f195f099e206efd3d17a9c9467b169715a3987
1917066https://github.com/modelcontextprotocol/python-sdk/commit/1917066e4daa03ddbb383a99e94d0c51a81d6626
Compare https://github.com/modelcontextprotocol/python-sdk/compare/e0f195f099e206efd3d17a9c9467b169715a3987..1917066e4daa03ddbb383a99e94d0c51a81d6626
April 25, 2025 02:30https://github.com/modelcontextprotocol/python-sdk/pull/586#event-17399527723
PWZERhttps://github.com/PWZER
April 25, 2025 11:21https://github.com/modelcontextprotocol/python-sdk/pull/586#commits-pushed-9cd4572
https://github.com/PWZER
use client_close_handler_callable for connect_ssehttps://github.com/modelcontextprotocol/python-sdk/pull/586/commits/9cd4572004195ecd20417c37506df6f5c43f7fd5
9cd4572https://github.com/modelcontextprotocol/python-sdk/pull/586/commits/9cd4572004195ecd20417c37506df6f5c43f7fd5
https://github.com/PWZER
fix pyrighthttps://github.com/modelcontextprotocol/python-sdk/pull/586/commits/fbe6b067d97d3f2a0af27ef00ec62ba044e60c0e
fbe6b06https://github.com/modelcontextprotocol/python-sdk/pull/586/commits/fbe6b067d97d3f2a0af27ef00ec62ba044e60c0e
https://github.com/PWZER
Fix: fastmcp exit stuckhttps://github.com/modelcontextprotocol/python-sdk/pull/586/commits/0090583074eb1b528a90ef8bf8d9bc53600ddd7f
0090583https://github.com/modelcontextprotocol/python-sdk/pull/586/commits/0090583074eb1b528a90ef8bf8d9bc53600ddd7f
https://github.com/PWZER
PWZERhttps://github.com/PWZER
Apr 25, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/586#ref-issue-2994309207
FastMCP server with SSE transport fails to shut down on a signal #514 https://github.com/modelcontextprotocol/python-sdk/issues/514
https://github.com/dsp-ant
dsp-anthttps://github.com/dsp-ant
April 25, 2025 13:49https://github.com/modelcontextprotocol/python-sdk/pull/586#event-17406915371
https://github.com/dsp-ant
dsp-anthttps://github.com/dsp-ant
Apr 25, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/586#pullrequestreview-2794199792
View reviewed changes https://github.com/modelcontextprotocol/python-sdk/pull/586/files/0090583074eb1b528a90ef8bf8d9bc53600ddd7f
pyproject.tomlhttps://github.com/modelcontextprotocol/python-sdk/pull/586/files/0090583074eb1b528a90ef8bf8d9bc53600ddd7f#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711
dsp-anthttps://github.com/dsp-ant
Apr 25, 2025https://github.com/modelcontextprotocol/python-sdk/pull/586#discussion_r2060283558
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/586
PWZERhttps://github.com/PWZER
Apr 27, 2025https://github.com/modelcontextprotocol/python-sdk/pull/586#discussion_r2061954442
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/586
https://github.com/ihrpr
ihrprhttps://github.com/ihrpr
2025-03-26 spec releasehttps://github.com/modelcontextprotocol/python-sdk/milestone/6
Apr 28, 2025https://github.com/modelcontextprotocol/python-sdk/pull/586#event-17431321099
https://github.com/nadeemcite
nadeemcitehttps://github.com/nadeemcite
Apr 28, 2025https://github.com/modelcontextprotocol/python-sdk/pull/586#issuecomment-2835721562
@PWZERhttps://github.com/PWZER
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/586
https://github.com/Spycsh
Spycshhttps://github.com/Spycsh
Apr 29, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/586#ref-pullrequest-3027209571
FEAT: Enable OPEA microservices to start as MCP servers opea-project/GenAIComps#1635 https://github.com/opea-project/GenAIComps/pull/1635
https://github.com/ihrpr
ihrprhttps://github.com/ihrpr
Apr 29, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/586#ref-pullrequest-3016678346
Fix handle sse disconnect event to free read_stream_writers[session_id] #582 https://github.com/modelcontextprotocol/python-sdk/pull/582
https://github.com/ihrpr
ihrprhttps://github.com/ihrpr
Apr 29, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/586#pullrequestreview-2802781405
View reviewed changes https://github.com/modelcontextprotocol/python-sdk/pull/586/files/0090583074eb1b528a90ef8bf8d9bc53600ddd7f
ihrprhttps://github.com/ihrpr
https://github.com/modelcontextprotocol/python-sdk/pull/586#pullrequestreview-2802781405
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/586
src/mcp/server/sse.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/586/files/0090583074eb1b528a90ef8bf8d9bc53600ddd7f#diff-db3d89720f05f9c8a375c9ce008a6b477be25dccabca86a7d422814c5ab3f12c
ihrprhttps://github.com/ihrpr
Apr 29, 2025https://github.com/modelcontextprotocol/python-sdk/pull/586#discussion_r2065949412
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/586
https://github.com/westonplatter
westonplatterhttps://github.com/westonplatter
May 4, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/586#ref-issue-3035072301
Server is Shutdown when hot reload (FastMCP + FastAPI) PrefectHQ/fastmcp#296 https://github.com/PrefectHQ/fastmcp/issues/296
https://github.com/lcamhoa
lcamhoahttps://github.com/lcamhoa
May 6, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/586#pullrequestreview-2816847944
View reviewed changes https://github.com/modelcontextprotocol/python-sdk/pull/586/files/0090583074eb1b528a90ef8bf8d9bc53600ddd7f
src/mcp/server/sse.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/586/files/0090583074eb1b528a90ef8bf8d9bc53600ddd7f#diff-db3d89720f05f9c8a375c9ce008a6b477be25dccabca86a7d422814c5ab3f12c
lcamhoahttps://github.com/lcamhoa
May 6, 2025https://github.com/modelcontextprotocol/python-sdk/pull/586#discussion_r2074716958
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
yieldhttps://github.com/modelcontextprotocol/python-sdk/blob/v1.3.x/src/mcp/server/sse.py#L131
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/586
https://github.com/ihrpr
ihrprhttps://github.com/ihrpr
Jul 8, 2025https://github.com/modelcontextprotocol/python-sdk/pull/586#issuecomment-3048614953
We can't update sse-starlette for nowhttps://github.com/modelcontextprotocol/python-sdk/pull/586#pullrequestreview-2802781405
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/586
https://github.com/ihrpr
ihrprhttps://github.com/ihrpr
Jul 8, 2025https://github.com/modelcontextprotocol/python-sdk/pull/586#event-18524677963
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/{{ revealButtonHref }}
Sign up for freehttps://github.com/join?source=comment-repo
Sign in to commenthttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F586
https://github.com/dsp-ant
dsp-ant https://github.com/dsp-ant
https://github.com/modelcontextprotocol/python-sdk/pull/586/files/0090583074eb1b528a90ef8bf8d9bc53600ddd7f
https://github.com/ihrpr
ihrpr https://github.com/ihrpr
https://github.com/modelcontextprotocol/python-sdk/pull/586/files/0090583074eb1b528a90ef8bf8d9bc53600ddd7f
https://github.com/lcamhoa
lcamhoa https://github.com/lcamhoa
https://github.com/modelcontextprotocol/python-sdk/pull/586/files/0090583074eb1b528a90ef8bf8d9bc53600ddd7f
2025-03-26 spec release https://github.com/modelcontextprotocol/python-sdk/milestone/6
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/586
https://github.com/PWZER
https://github.com/nadeemcite
https://github.com/ihrpr
https://github.com/lcamhoa
https://github.com/dsp-ant
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.