René's URL Explorer Experiment


Title: [v2] Allow MCPServer to disable subscriptions/listen · Issue #3357 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: [v2] Allow MCPServer to disable subscriptions/listen · Issue #3357 · modelcontextprotocol/python-sdk

X Title: [v2] Allow MCPServer to disable subscriptions/listen · Issue #3357 · modelcontextprotocol/python-sdk

Description: Initial Checks I confirm that I'm using the newest release of my line (the latest 2.x, or the latest 1.x if I'm still on v1) I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before openi...

Open Graph Description: Initial Checks I confirm that I'm using the newest release of my line (the latest 2.x, or the latest 1.x if I'm still on v1) I confirm that I searched for my issue in https://github.com/modelcontex...

X Description: Initial Checks I confirm that I'm using the newest release of my line (the latest 2.x, or the latest 1.x if I'm still on v1) I confirm that I searched for my issue in https://github.com/mod...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[v2] Allow MCPServer to disable subscriptions/listen","articleBody":"### Initial Checks\n\n- [x] I confirm that I'm using the newest release of my line (the latest 2.x, or the latest 1.x if I'm still on v1)\n- [x] I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this issue\n\n### Release line\n\n2.x (current stable)\n\n### Description\n\n#### What happened?\n`MCPServer` always installs a `subscriptions/listen` handler:\n```python\non_subscriptions_listen=ListenHandler(self._subscriptions)\n```\nThe constructor exposes `subscriptions: SubscriptionBus | None = None`, but `None` creates an `InMemorySubscriptionBus`; it does not disable subscriptions.\n\nThis causes `server/discover` to advertise:\n```json\n{\n  \"tools\": {\"listChanged\": true},\n  \"prompts\": {\"listChanged\": true},\n  \"resources\": {\"listChanged\": true, \"subscribe\": true}\n}\n```\nOur MCP server has a static catalog and never publishes change notifications. It runs as a stateless Streamable HTTP server on AWS Lambda.\n\nClaude Code 2.1.235 automatically opened four subscriptions/listen streams during discovery. Each request followed the long-lived SSE path and held a Lambda invocation until timeout.\n\nWe currently reject these requests in ASGI middleware. This prevents the timeout, but the server still advertises subscription support, so clients continue attempting the requests.\n\nThe low-level Server supports disabling this correctly through:\n```python\nServer(..., on_subscriptions_listen=None)\n```\nThe high-level `MCPServer` has no equivalent public option. Removing the handler through `_lowlevel_server._request_handlers` works, but relies on private internals.\n\n#### What did you expect?\n``MCPServer`` should provide a supported opt-out, for example:\n```python\nMCPServer(..., subscriptions=False)\n```\nor:\n```python\nMCPServer(..., enable_subscriptions=False)\n```\nWhen disabled:\n- `subscriptions/listen` should not be registered.\n- server/discover should advertise the relevant change and subscription capabilities as false.\n- An unsolicited subscriptions/listen call should return Method not found.\n- Existing behavior should remain the default for compatibility.\nThis matches SEP-2575’s stateless-first, “pay as you go” design. Long-lived streams should only be enabled when the server uses them.\n\n#### Area\n`Server`\n\n#### References\n- [SEP-2575](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/seps/2575-stateless-mcp.md)\n- [Subscription implementation PR #3035](https://github.com/modelcontextprotocol/python-sdk/pull/3035)\n- [Capabilities issue #2896](https://github.com/modelcontextprotocol/python-sdk/issues/2896)\n\nAI assistance disclosure: I used an AI coding assistant to inspect the SDK source and help draft this report. I reviewed and verified the contents.\n\n### Example Code\n\n```Python\nfrom mcp.server import MCPServer\n\nserver = MCPServer(\"static-server\")\n\ncapabilities = server._lowlevel_server.get_capabilities(\n    protocol_version=\"2026-07-28\"\n)\n\nprint(capabilities.model_dump(by_alias=True, exclude_none=True))\n```\n\n### Python & MCP Python SDK\n\n```Text\nPython 3.11\nmcp 2.0.0\nAWS Lambda\nStreamable HTTP\njson_response=True\nstateless_http=True\n```","author":{"url":"https://github.com/owlofjaylan","@type":"Person","name":"owlofjaylan"},"datePublished":"2026-08-21T19:18:08Z","url":"https://github.com/modelcontextprotocol/python-sdk/issues/3357"}

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:25baeda9-9f6c-70c9-e1dc-7e2a58e6d3da
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id841A:199A0D:29FEE22:370DFCB:6B055D16
html-safe-noncecdb6913be35d0be368186112303ad4a86c86be27b7c00ef345eb330a7c1d8c59
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NDFBOjE5OUEwRDoyOUZFRTIyOjM3MERGQ0I6NkIwNTVEMTYiLCJ2aXNpdG9yX2lkIjoiNjQzMjQzNTg2ODA0MDI1Njc5MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac9b1cefe393bcaa4d45aa1ffdec57339a20a6b88ddc3fe709e6f7ec2fa8d71676
hovercard-subject-tagissue:5217414270
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/3357/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c0a6c5b13480dc83a010390f339fbed2b81b1cdbb96cc2d0001605767c15798c/modelcontextprotocol/python-sdk/issues/3357
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c0a6c5b13480dc83a010390f339fbed2b81b1cdbb96cc2d0001605767c15798c/modelcontextprotocol/python-sdk/issues/3357
og:image:altInitial Checks I confirm that I'm using the newest release of my line (the latest 2.x, or the latest 1.x if I'm still on v1) I confirm that I searched for my issue in https://github.com/modelcontex...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameowlofjaylan
hostnamegithub.com
expected-hostnamegithub.com
None8a6760da3cce5e2d079d07e3b62df71194316c4478db1a5e38050f44fce72c72
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
release8327739ac0648b9c3c722b5f401f7338553936b8
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/issues/3357#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F3357
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%2F3357
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/3357
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/3357
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/3357
modelcontextprotocolhttps://github.com/modelcontextprotocol
python-sdkhttps://github.com/modelcontextprotocol/python-sdk
Codehttps://github.com/modelcontextprotocol/python-sdk
Issues320 (320)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/3357
New issuehttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3357
#3626https://github.com/modelcontextprotocol/python-sdk/pull/3626
[v2] Allow MCPServer to disable subscriptions/listenhttps://github.com/modelcontextprotocol/python-sdk/issues/3357#top
#3626https://github.com/modelcontextprotocol/python-sdk/pull/3626
spec-2026-07-28https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22spec-2026-07-28%22
v2https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22v2%22
https://github.com/owlofjaylan
owlofjaylanhttps://github.com/owlofjaylan
on Aug 21, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3357#issue-5217414270
https://github.com/modelcontextprotocol/python-sdk/issueshttps://github.com/modelcontextprotocol/python-sdk/issues
SEP-2575https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/seps/2575-stateless-mcp.md
Subscription implementation PR #3035https://github.com/modelcontextprotocol/python-sdk/pull/3035
Capabilities issue #2896https://github.com/modelcontextprotocol/python-sdk/issues/2896
https://github.com/mikerva
mikervahttps://github.com/mikerva
on Aug 21, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3357#issuecomment-5374392013
https://github.com/thijn-minerva
thijn-minervahttps://github.com/thijn-minerva
on Aug 21, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3357#issuecomment-5374424359
claudehttps://github.com/apps/claude
v2https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22v2%22
spec-2026-07-28https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22spec-2026-07-28%22
on Aug 21, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3357#event-29824529946
https://github.com/owlofjaylan
owlofjaylanhttps://github.com/owlofjaylan
on Aug 24, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3357#issuecomment-5395107916
https://github.com/tomoki-takahashi-oisix
tomoki-takahashi-oisixhttps://github.com/tomoki-takahashi-oisix
on Sep 14, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3357#issuecomment-5657234425
#3493https://github.com/modelcontextprotocol/python-sdk/issues/3493
#3357https://github.com/modelcontextprotocol/python-sdk/issues/3357
#3493https://github.com/modelcontextprotocol/python-sdk/issues/3493
https://github.com/1320800521
1320800521https://github.com/1320800521
on Sep 20, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3357#issuecomment-5748661725
https://github.com/xbstack/mcp-subscriptions-listen-serverless-reprohttps://github.com/xbstack/mcp-subscriptions-listen-serverless-repro
https://www.xbstack.com/ai/mcp-streamable-http-deployment/?utm_source=github&utm_medium=referral&utm_campaign=mcp_subscriptions_listen_serverless&utm_content=issue_reply&ref=githubhttps://www.xbstack.com/ai/mcp-streamable-http-deployment/?utm_source=github&utm_medium=referral&utm_campaign=mcp_subscriptions_listen_serverless&utm_content=issue_reply&ref=github
maxisbeyhttps://github.com/maxisbey
MCPServer serves subscriptions/listen and advertises listChanged=true unconditionally — hold-open streams pin serverless invocations to the platform timeout #3493https://github.com/modelcontextprotocol/python-sdk/issues/3493
on Oct 1, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3357#event-32251537032
https://github.com/mikerva
mikervahttps://github.com/mikerva
on Oct 1, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3357#issuecomment-5931686304
maxisbeyhttps://github.com/maxisbey
completedhttps://github.com/modelcontextprotocol/python-sdk/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#3626https://github.com/modelcontextprotocol/python-sdk/pull/3626
on Oct 2, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3357#event-32336437215
https://github.com/maxisbey
maxisbeyhttps://github.com/maxisbey
on Oct 2, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3357#issuecomment-5957151443
#3626https://github.com/modelcontextprotocol/python-sdk/pull/3626
Turning it offhttps://py.sdk.modelcontextprotocol.io/handlers/subscriptions/#turning-it-off
#2896https://github.com/modelcontextprotocol/python-sdk/issues/2896
AI Disclaimerhttps://gist.github.com/maxisbey/6123d132484e4c533eab519a2800693d
https://github.com/1320800521
1320800521https://github.com/1320800521
on Oct 8, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3357#issuecomment-6057316952
ChatGPT Codex Connectorhttps://www.chatgpt.com
Python SDK v2.3.0 release noteshttps://github.com/modelcontextprotocol/python-sdk/releases/tag/v2.3.0
#3626https://github.com/modelcontextprotocol/python-sdk/pull/3626
https://www.xbstack.com/en/ai/mcp-streamable-http-deployment/?utm_source=github&utm_medium=referral&utm_campaign=mcp_subscriptions_optout_v230&utm_content=issue_followuphttps://www.xbstack.com/en/ai/mcp-streamable-http-deployment/?utm_source=github&utm_medium=referral&utm_campaign=mcp_subscriptions_optout_v230&utm_content=issue_followup
Sign up for freehttps://github.com/signup?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3357
Sign in to commenthttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3357
spec-2026-07-28https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22spec-2026-07-28%22
v2https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22v2%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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.