René's URL Explorer Experiment


Title: Active Streamable HTTP sessions are not terminated during shutdown · Issue #2150 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: Active Streamable HTTP sessions are not terminated during shutdown · Issue #2150 · modelcontextprotocol/python-sdk

X Title: Active Streamable HTTP sessions are not terminated during shutdown · Issue #2150 · modelcontextprotocol/python-sdk

Description: Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this issue Description Context This is primar...

Open Graph Description: Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this ...

X Description: Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening t...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Active Streamable HTTP sessions are not terminated during shutdown","articleBody":"### Initial Checks\n\n- [x] I confirm that I'm using the latest version of MCP Python SDK\n- [x] I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this issue\n\n### Description\n\n## Context\nThis is primarily a repost of [this fastmcp issue](https://github.com/PrefectHQ/fastmcp/issues/3025) as it seems to actually be a bug in the mcp python sdk and I want to make sure we've got visibility over here.\n\n> When shutting down a FastMCP server (CTRL+C) while clients have active streaming connections, Uvicorn logs:\n> \n> ```\n> ERROR: ASGI callable returned without completing response.\n> ```\n> \n> The error occurs because StreamableHTTPSessionManager cancels the task group without first gracefully terminating active SSE/streaming connections.\n\nExpected behavior would be the active connections being closed with a proper http response before the rest of shutdown.\n\n### Example Code\n\n```Python\nfrom fastmcp import FastMCP\n\nmcp = FastMCP(\"Test Server\")\n\n@mcp.tool\ndef hello() -> str:\n  return \"Hello, World!\"\n\nif __name__ == \"__main__\":\n  mcp.run(transport=\"streamable-http\", port=8000)\n```\n\n### Python & MCP Python SDK\n\n```Text\nPython 3.12\nMCP Python SDK 1.26.0\n```","author":{"url":"https://github.com/emmahoggan","@type":"Person","name":"emmahoggan"},"datePublished":"2026-02-26T18:53:02Z","url":"https://github.com/modelcontextprotocol/python-sdk/issues/2150"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:16ba95d1-e1f5-82ee-5d45-c0892387cce0
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB452:16E5D2:1EF362:28925B:6AFD01E7
html-safe-nonce7c09bc59d9e683cb07f887aaa5795f9a3298a3c898d08d5073415f8f19a24d90
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDUyOjE2RTVEMjoxRUYzNjI6Mjg5MjVCOjZBRkQwMUU3IiwidmlzaXRvcl9pZCI6IjIzNTA2NDg3NDU0OTU2OTE3NTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac4fc732b8db820ed9bf0ef9232c92448c8d1673cc40b200b98acfe87ab6ae6e39
hovercard-subject-tagissue:3997210214
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/python-sdk/2150/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3740c3ebf8ddd1ceb324d0cc5c5788372313718df9076dfa1d44f8a377f0591a/modelcontextprotocol/python-sdk/issues/2150
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3740c3ebf8ddd1ceb324d0cc5c5788372313718df9076dfa1d44f8a377f0591a/modelcontextprotocol/python-sdk/issues/2150
og:image:altInitial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameemmahoggan
hostnamegithub.com
expected-hostnamegithub.com
None8fd5a24ae29aa78df114eaaf1f9a839e8c3b7c0d27549e4f54678bb7cf3166d4
turbo-cache-controlno-preview
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
releasedd0990b833f227378ab84f1d9519db1a04660550
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/issues/2150#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F2150
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F2150
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=modelcontextprotocol%2Fpython-sdk
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/2150
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/2150
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/2150
modelcontextprotocolhttps://github.com/modelcontextprotocol
python-sdkhttps://github.com/modelcontextprotocol/python-sdk
Codehttps://github.com/modelcontextprotocol/python-sdk
Issues305 (305)https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests112 (112)https://github.com/modelcontextprotocol/python-sdk/pulls
Actionshttps://github.com/modelcontextprotocol/python-sdk/actions
Projectshttps://github.com/modelcontextprotocol/python-sdk/projects
Security and quality12 (12)https://github.com/modelcontextprotocol/python-sdk/security
Insightshttps://github.com/modelcontextprotocol/python-sdk/insights
https://github.com/modelcontextprotocol/python-sdk
New issuehttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/2150
New issuehttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/2150
Active Streamable HTTP sessions are not terminated during shutdownhttps://github.com/modelcontextprotocol/python-sdk/issues/2150#top
P2Moderate issues affecting some users, edge cases, potentially valuable featurehttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22P2%22
bugSomething isn't workinghttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%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
https://github.com/emmahoggan
emmahogganhttps://github.com/emmahoggan
on Feb 26, 2026https://github.com/modelcontextprotocol/python-sdk/issues/2150#issue-3997210214
https://github.com/modelcontextprotocol/python-sdk/issueshttps://github.com/modelcontextprotocol/python-sdk/issues
this fastmcp issuehttps://github.com/PrefectHQ/fastmcp/issues/3025
by22Jyhttps://github.com/by22Jy
on Feb 28, 2026https://github.com/modelcontextprotocol/python-sdk/issues/2150#event-23152196558
fix: gracefully terminate active SSE connections during shutdownhttps://github.com/by22Jy/python-sdk/commit/c417f5610b915acf82a8e20b18a13a4e9301d86e
https://docs.github.com/articles/closing-issues-via-commit-messages
c417f56https://github.com/by22Jy/python-sdk/commit/c417f5610b915acf82a8e20b18a13a4e9301d86e
maxisbeyhttps://github.com/maxisbey
bugSomething isn't workinghttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%22
P2Moderate issues affecting some users, edge cases, potentially valuable featurehttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22P2%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
on Mar 5, 2026https://github.com/modelcontextprotocol/python-sdk/issues/2150#event-23302478918
https://github.com/weiguangli-io
weiguangli-iohttps://github.com/weiguangli-io
on Mar 9, 2026https://github.com/modelcontextprotocol/python-sdk/issues/2150#issuecomment-4021823785
weiguangli-iohttps://github.com/weiguangli-io
on Mar 9, 2026https://github.com/modelcontextprotocol/python-sdk/issues/2150#event-23394695739
fix: terminate active StreamableHTTP sessions during shutdown (modelc…https://github.com/weiguangli-io/python-sdk/commit/43e5a9d607a204b18a6bd8a8fdfe8449a727e0f7
modelc…https://github.com/modelcontextprotocol/python-sdk/issues/2150
43e5a9dhttps://github.com/weiguangli-io/python-sdk/commit/43e5a9d607a204b18a6bd8a8fdfe8449a727e0f7
https://github.com/Hackerchen716
Hackerchen716https://github.com/Hackerchen716
on May 29, 2026https://github.com/modelcontextprotocol/python-sdk/issues/2150#issuecomment-4576129269
https://github.com/ItWasYou-SAM
ItWasYou-SAMhttps://github.com/ItWasYou-SAM
on Jul 12, 2026https://github.com/modelcontextprotocol/python-sdk/issues/2150#issuecomment-4951010067
baiyuxi930826https://github.com/baiyuxi930826
on Jul 18, 2026https://github.com/modelcontextprotocol/python-sdk/issues/2150#event-28156045086
style: satisfy markdownlint on modelcontextprotocol#2150 noteshttps://github.com/baiyuxi930826/python-sdk/commit/60e6030426d4ccd224dc48558922c426d512dc68
modelcontextprotocol#2150https://github.com/modelcontextprotocol/python-sdk/issues/2150
60e6030https://github.com/baiyuxi930826/python-sdk/commit/60e6030426d4ccd224dc48558922c426d512dc68
test(server): cover terminate cleanup of orphaned request streamshttps://github.com/baiyuxi930826/python-sdk/commit/a6976e1a981e1550ac5b990bf678ce826e86bb8f
a6976e1https://github.com/baiyuxi930826/python-sdk/commit/a6976e1a981e1550ac5b990bf678ce826e86bb8f
Sign up for freehttps://github.com/signup?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/2150
Sign in to commenthttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/2150
P2Moderate issues affecting some users, edge cases, potentially valuable featurehttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22P2%22
bugSomething isn't workinghttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%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
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.