René's URL Explorer Experiment


Title: Close server session after handle stateless request by hopeful0 · Pull Request #1116 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: Close server session after handle stateless request by hopeful0 · Pull Request #1116 · modelcontextprotocol/python-sdk

X Title: Close server session after handle stateless request by hopeful0 · Pull Request #1116 · modelcontextprotocol/python-sdk

Description: The official Python SDK for Model Context Protocol servers and clients - Close server session after handle stateless request by hopeful0 · Pull Request #1116 · modelcontextprotocol/python-sdk

Open Graph Description: Motivation and Context The ServerSession created by stateless Streamable HTTP requests is not being properly cleaned up, leading to memory leaks, which may be related to #1076. This PR allows the ...

X Description: Motivation and Context The ServerSession created by stateless Streamable HTTP requests is not being properly cleaned up, leading to memory leaks, which may be related to #1076. This PR allows the ...

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

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:ce7f76fa-e1f6-da21-f432-b178e44040c7
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA2C4:2F9DF3:343902:4AD539:6A59DBD8
html-safe-nonce5659cc451ee302e70273e12f1f0e68dd1ec869c4df15b447b46313b968af5ba3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMkM0OjJGOURGMzozNDM5MDI6NEFENTM5OjZBNTlEQkQ4IiwidmlzaXRvcl9pZCI6IjMzMzgyMTgxNDk1NDQzMTk5NjAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac7c96845e56f7b4cac961d80ba9ebd3c3f56e46dde4f493eb8d8f1c0185ebc294
hovercard-subject-tagpull_request:2654672496
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/1116/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/e70f312c47752fd2f2ff5150bd9210e30ab7b8da94f3cddccd7280adf93dd49b/modelcontextprotocol/python-sdk/pull/1116
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e70f312c47752fd2f2ff5150bd9210e30ab7b8da94f3cddccd7280adf93dd49b/modelcontextprotocol/python-sdk/pull/1116
og:image:altMotivation and Context The ServerSession created by stateless Streamable HTTP requests is not being properly cleaned up, leading to memory leaks, which may be related to #1076. This PR allows the ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamehopeful0
hostnamegithub.com
expected-hostnamegithub.com
Noneba3976babb66479b1c943a8edc0777d96157da48fadc0161f9ddb219deee8353
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
release26f17126414f953984d8ae42f57c0db48e7dbde3
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/pull/1116#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F1116
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%2F1116
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/1116
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/1116
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/1116
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1116
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 255 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
felixweinbergerhttps://github.com/felixweinberger
modelcontextprotocol:mainhttps://github.com/modelcontextprotocol/python-sdk/tree/main
hopeful0:stateless-server-session-closehttps://github.com/hopeful0/mcp/tree/stateless-server-session-close
Conversationhttps://github.com/modelcontextprotocol/python-sdk/pull/1116
Commits2 (2)https://github.com/modelcontextprotocol/python-sdk/pull/1116/commits
Checkshttps://github.com/modelcontextprotocol/python-sdk/pull/1116/checks
Files changedhttps://github.com/modelcontextprotocol/python-sdk/pull/1116/files
Close server session after handle stateless requesthttps://github.com/modelcontextprotocol/python-sdk/pull/1116#top
felixweinbergerhttps://github.com/felixweinberger
modelcontextprotocol:mainhttps://github.com/modelcontextprotocol/python-sdk/tree/main
hopeful0:stateless-server-session-closehttps://github.com/hopeful0/mcp/tree/stateless-server-session-close
https://github.com/hopeful0
hopeful0https://github.com/hopeful0
Jul 10, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1116#issue-3217927760
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1116
#1076https://github.com/modelcontextprotocol/python-sdk/issues/1076
MCP Documentationhttps://modelcontextprotocol.io
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1116
https://github.com/hopeful0
Close server session after handle stateless requesthttps://github.com/modelcontextprotocol/python-sdk/pull/1116/commits/342a6b5f3e8eebda8f14f8fc3b6f2343b5060cb6
342a6b5https://github.com/modelcontextprotocol/python-sdk/pull/1116/commits/342a6b5f3e8eebda8f14f8fc3b6f2343b5060cb6
https://github.com/hopeful0
hopeful0https://github.com/hopeful0
Jul 10, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1116#ref-pullrequest-3219025242
Add StatefulProxyClient PrefectHQ/fastmcp#1109 https://github.com/PrefectHQ/fastmcp/pull/1109
https://github.com/felixweinberger
felixweinbergerhttps://github.com/felixweinberger
July 11, 2025 12:35https://github.com/modelcontextprotocol/python-sdk/pull/1116#event-18585667284
https://github.com/felixweinberger
felixweinbergerhttps://github.com/felixweinberger
Jul 11, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1116#event-18585676359
https://github.com/felixweinberger
felixweinbergerhttps://github.com/felixweinberger
Jul 11, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1116#pullrequestreview-3011574024
View reviewed changes https://github.com/modelcontextprotocol/python-sdk/pull/1116/files/342a6b5f3e8eebda8f14f8fc3b6f2343b5060cb6
felixweinbergerhttps://github.com/felixweinberger
https://github.com/modelcontextprotocol/python-sdk/pull/1116#pullrequestreview-3011574024
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1116
src/mcp/server/streamable_http_manager.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/1116/files/342a6b5f3e8eebda8f14f8fc3b6f2343b5060cb6#diff-1071ee05567116cb77322c376307b9071c6212871068ccf41911fc337ed473af
felixweinbergerhttps://github.com/felixweinberger
Jul 11, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1116#discussion_r2201567744
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1116
hopeful0https://github.com/hopeful0
Jul 12, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1116#discussion_r2202819365
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1116
felixweinbergerhttps://github.com/felixweinberger
Jul 14, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1116#discussion_r2205057699
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1116
hopeful0https://github.com/hopeful0
Jul 14, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1116#discussion_r2205205334
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1116
https://github.com/hopeful0
hopeful0https://github.com/hopeful0
Jul 12, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1116#issuecomment-3065881118
#1076https://github.com/modelcontextprotocol/python-sdk/issues/1076
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1116
https://github.com/felixweinberger
felixweinbergerhttps://github.com/felixweinberger
July 14, 2025 14:15https://github.com/modelcontextprotocol/python-sdk/pull/1116#event-18619162270
https://github.com/hopeful0
Rename _terminate_session to terminal in StreamableHTTPServerTransporthttps://github.com/modelcontextprotocol/python-sdk/pull/1116/commits/826ec0a3cec5e74525c034b5fa93cdcdf20a58c1
826ec0ahttps://github.com/modelcontextprotocol/python-sdk/pull/1116/commits/826ec0a3cec5e74525c034b5fa93cdcdf20a58c1
https://github.com/felixweinberger
felixweinbergerhttps://github.com/felixweinberger
Jul 14, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1116#pullrequestreview-3016987024
View reviewed changes https://github.com/modelcontextprotocol/python-sdk/pull/1116/files/826ec0a3cec5e74525c034b5fa93cdcdf20a58c1
felixweinbergerhttps://github.com/felixweinberger
https://github.com/modelcontextprotocol/python-sdk/pull/1116#pullrequestreview-3016987024
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1116
https://github.com/felixweinberger
felixweinbergerhttps://github.com/felixweinberger
b8cb367https://github.com/modelcontextprotocol/python-sdk/commit/b8cb3675dc869f825c5d52e5ddaf9a00f369d3aa
Jul 14, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1116#event-18621514970
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1116
https://github.com/felixweinberger
felixweinbergerhttps://github.com/felixweinberger
Jul 14, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1116#event-18621519963
https://github.com/hopeful0
hopeful0https://github.com/hopeful0
July 14, 2025 16:34https://github.com/modelcontextprotocol/python-sdk/pull/1116#event-18621655598
https://github.com/felixweinberger
felixweinbergerhttps://github.com/felixweinberger
Jul 14, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1116#ref-pullrequest-3229348211
Add regression test for stateless request memory cleanup #1140 https://github.com/modelcontextprotocol/python-sdk/pull/1140
https://github.com/felixweinberger
felixweinbergerhttps://github.com/felixweinberger
Jul 14, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1116#issuecomment-3070238211
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1116
#1140https://github.com/modelcontextprotocol/python-sdk/pull/1140
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1116
felixweinbergerhttps://github.com/felixweinberger
Jul 14, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1116#ref-commit-01e7434
https://github.com/felixweinberger
test: Add regression test for stateless request memory cleanuphttps://github.com/modelcontextprotocol/python-sdk/commit/01e743463012975e456fbbb84114f93bc5a7ba05
01e7434https://github.com/modelcontextprotocol/python-sdk/commit/01e743463012975e456fbbb84114f93bc5a7ba05
#1116https://github.com/modelcontextprotocol/python-sdk/pull/1116
#1116https://github.com/modelcontextprotocol/python-sdk/pull/1116
https://github.com/felixweinberger
felixweinbergerhttps://github.com/felixweinberger
Jul 15, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1116#ref-issue-3074488474
Stateless Mode memory leak #756 https://github.com/modelcontextprotocol/python-sdk/issues/756
https://github.com/Kludex
Kludexhttps://github.com/Kludex
Jul 15, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1116#pullrequestreview-3020161801
View reviewed changes https://github.com/modelcontextprotocol/python-sdk/pull/1116/files/826ec0a3cec5e74525c034b5fa93cdcdf20a58c1
src/mcp/server/streamable_http_manager.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/1116/files/826ec0a3cec5e74525c034b5fa93cdcdf20a58c1#diff-1071ee05567116cb77322c376307b9071c6212871068ccf41911fc337ed473af
Kludexhttps://github.com/Kludex
Jul 15, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1116#discussion_r2207400062
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1116
hopeful0https://github.com/hopeful0
Jul 15, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1116#discussion_r2208012361
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1116
https://github.com/hopeful0
hopeful0https://github.com/hopeful0
Jul 16, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1116#ref-pullrequest-3236551189
Add idle timeout termination for StreamableHTTPServerTransport #1159 https://github.com/modelcontextprotocol/python-sdk/pull/1159
https://github.com/WooXinyi
WooXinyihttps://github.com/WooXinyi
Jul 18, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1116#ref-issue-3173978423
【Memory Leak】Under pressure testing, there will be a memory leak until OOM (Out of Memory) occurs. PrefectHQ/fastmcp#941 https://github.com/PrefectHQ/fastmcp/issues/941
https://github.com/felixweinberger
felixweinbergerhttps://github.com/felixweinberger
Oct 30, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1116#ref-issue-3570401521
Implement SEP-1442: Make MCP Stateless #1544 https://github.com/modelcontextprotocol/python-sdk/issues/1544
https://github.com/AxelFooley
AxelFooleyhttps://github.com/AxelFooley
Jan 19, 2026 https://github.com/modelcontextprotocol/python-sdk/pull/1116#ref-issue-3820646105
Memory Leak in Stateless streamableHttp Mode - Child Processes Never Cleaned Up supercorp-ai/supergateway#108 https://github.com/supercorp-ai/supergateway/issues/108
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%2F1116
https://github.com/Kludex
Kludex https://github.com/Kludex
https://github.com/modelcontextprotocol/python-sdk/pull/1116/files/826ec0a3cec5e74525c034b5fa93cdcdf20a58c1
https://github.com/felixweinberger
felixweinberger https://github.com/felixweinberger
https://github.com/modelcontextprotocol/python-sdk/pull/1116/files/826ec0a3cec5e74525c034b5fa93cdcdf20a58c1
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1116
https://github.com/hopeful0
https://github.com/felixweinberger
https://github.com/Kludex
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.