René's URL Explorer Experiment


Title: MCPServer: ctx.notify_tools_changed() is a silent no-op on handshake-era (2025-11-25) connections, and tools.listChanged is advertised as false · Issue #3862 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: MCPServer: ctx.notify_tools_changed() is a silent no-op on handshake-era (2025-11-25) connections, and tools.listChanged is advertised as false · Issue #3862 · modelcontextprotocol/python-sdk

X Title: MCPServer: ctx.notify_tools_changed() is a silent no-op on handshake-era (2025-11-25) connections, and tools.listChanged is advertised as false · Issue #3862 · modelcontextprotocol/python-sdk

Description: Summary On a connection opened with the initialize handshake (2025-11-25 and earlier), MCPServer has two problems: It advertises tools: {listChanged: false}, even though add_tool() / remove_tool() change the list at runtime. MCPServer.ru...

Open Graph Description: Summary On a connection opened with the initialize handshake (2025-11-25 and earlier), MCPServer has two problems: It advertises tools: {listChanged: false}, even though add_tool() / remove_tool() ...

X Description: Summary On a connection opened with the initialize handshake (2025-11-25 and earlier), MCPServer has two problems: It advertises tools: {listChanged: false}, even though add_tool() / remove_tool() ...

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

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":"MCPServer: ctx.notify_tools_changed() is a silent no-op on handshake-era (2025-11-25) connections, and tools.listChanged is advertised as false","articleBody":"### Summary\n\nOn a connection opened with the `initialize` handshake (2025-11-25 and earlier), `MCPServer` has two problems:\n\n1. It advertises `tools: {listChanged: false}`, even though `add_tool()` / `remove_tool()` change the list at runtime. `MCPServer.run()` gives no public way to pass `NotificationOptions(tools_changed=True)`.\n2. `Context.notify_tools_changed()` publishes only to the `subscriptions/listen` bus. A handshake-era client gets nothing, and there is no error or warning. `notify_prompts_changed()` and `notify_resources_changed()` probably behave the same way (not tested).\n\nThe 2026-07-28 path works. So a server written against the documented API updates its tool list for modern clients and silently never does for handshake clients.\n\n### Why it matters now\n\nGoose 1.57.0 negotiates 2026-07-28 but never opens `subscriptions/listen` (aaif-goose/goose#13055). The only way to get a tool-list change to Goose today is the 2025-11-25 era, and this bug drops it there. The Goose side works: with the workaround below, Goose lists and calls a tool added mid-turn.\n\nWorkaround we use: `await ctx.request_context.session.send_tool_list_changed()`, plus serving with `create_initialization_options(NotificationOptions(tools_changed=True))`.\n\n### Reproduction (mcp 2.3.0, Python 3.14)\n\nBoth tests fail. Replacing `ctx.notify_tools_changed()` with `ctx.request_context.session.send_tool_list_changed()` makes the second pass, which shows the client side is fine.\n\n```python\nimport anyio\nimport mcp_types as types\nimport pytest\n\nfrom mcp.client.client import Client\nfrom mcp.server.mcpserver import Context, MCPServer\n\npytestmark = pytest.mark.anyio\n\n\ndef _server() -> MCPServer:\n    server = MCPServer(\"listchanged-handshake\")\n\n    def late_tool() -> str:\n        \"\"\"Registered at runtime.\"\"\"\n        return \"late\"\n\n    @server.tool()\n    async def enable(ctx: Context) -> str:\n        \"\"\"Register late_tool and announce it with the public Context API.\"\"\"\n        server.add_tool(late_tool)\n        await ctx.notify_tools_changed()\n        return \"enabled\"\n\n    return server\n\n\nasync def test_handshake_client_is_told_tools_list_changed_is_supported() -> None:\n    \"\"\"A server that can change its tools says so to a 2025-11-25 client.\"\"\"\n    async with Client(_server(), mode=\"legacy\") as client:\n        assert client.protocol_version == \"2025-11-25\"\n        tools = client.server_capabilities.tools\n        assert tools is not None and tools.list_changed is True  # fails: False\n\n\nasync def test_notify_tools_changed_reaches_handshake_client() -> None:\n    \"\"\"ctx.notify_tools_changed() sends tools/list_changed to a 2025-11-25 client.\"\"\"\n    received = anyio.Event()\n\n    async def on_message(message: object) -> None:\n        if isinstance(message, types.ToolListChangedNotification):\n            received.set()\n\n    async with Client(_server(), mode=\"legacy\", message_handler=on_message) as client:\n        await client.call_tool(\"enable\", {})\n        with anyio.move_on_after(1):\n            await received.wait()\n        assert received.is_set(), \"notify_tools_changed() sent nothing\"  # fails\n        assert \"late_tool\" in {tool.name for tool in (await client.list_tools()).tools}\n```\n\n### Expected\n\nOn handshake-era connections:\n\n- Advertise `listChanged: true` for tools, or at least make it configurable from `MCPServer`.\n- Have `notify_*_changed()` send `notifications/*/list_changed` on the session. That era has no subscription filter, and a server that declared `listChanged` may send these notifications.\n\n### Related\n\n- #1429: send the notification automatically on `add_tool()` / `remove_tool()`. Older than the era split.\n- #1486: `NotificationOptions` for FastMCP (stale).\n- #3851: the era is latched by the first request.\n- aaif-goose/goose#13055\n\n---\n\n_Generated by [Claude Code](https://claude.ai/code)_\n","author":{"url":"https://github.com/dcode","@type":"Person","name":"dcode"},"datePublished":"2026-11-14T17:17:34Z","url":"https://github.com/modelcontextprotocol/python-sdk/issues/3862"}

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:dd3d6fe7-1a04-63d1-4b50-536dfdd78db1
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB596:1FFF:DCAF22:13016ED:6B056552
html-safe-nonced15555424547403092d272b4b5e172c6555104c6c0e6c79e73fd45ed9493c3e0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNTk2OjFGRkY6RENBRjIyOjEzMDE2RUQ6NkIwNTY1NTIiLCJ2aXNpdG9yX2lkIjoiNDgzNDczMjc2MDA1NDk4MTk3MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac7947c6cd3c4bb3b607e9337e3b4e82cb0131d1fae85e251c35d1bb539a0a2853
hovercard-subject-tagissue:6393431727
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/3862/issue_layout
twitter:imagehttps://opengraph.githubassets.com/0a054ec66985645273a9435f17e723a7a02d1b8f4591c0116df1fe7ef823c96a/modelcontextprotocol/python-sdk/issues/3862
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/0a054ec66985645273a9435f17e723a7a02d1b8f4591c0116df1fe7ef823c96a/modelcontextprotocol/python-sdk/issues/3862
og:image:altSummary On a connection opened with the initialize handshake (2025-11-25 and earlier), MCPServer has two problems: It advertises tools: {listChanged: false}, even though add_tool() / remove_tool() ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedcode
hostnamegithub.com
expected-hostnamegithub.com
None1be5cc09efdd4833c24a4ffa71d698e3999fa09071e159fe14c2c08e41c98331
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
releasef6d69234e682c947a48074340e69d45d5901de31
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/issues/3862#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F3862
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%2F3862
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/3862
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/3862
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/3862
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/3862
New issuehttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3862
MCPServer: ctx.notify_tools_changed() is a silent no-op on handshake-era (2025-11-25) connections, and tools.listChanged is advertised as falsehttps://github.com/modelcontextprotocol/python-sdk/issues/3862#top
bughttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%22
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/dcode
dcodehttps://github.com/dcode
on Nov 14, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3862#issue-6393431727
aaif-goose/goose#13055https://github.com/aaif-goose/goose/issues/13055
feat: enhance dynamic tool management with notifications and enable/disable #1429https://github.com/modelcontextprotocol/python-sdk/issues/1429
feat: Add support for specifying NotificationOptions  #1486https://github.com/modelcontextprotocol/python-sdk/pull/1486
stdio dual-era server refuses initialize after a failed server/discover probe (era latched by the first request) #3851https://github.com/modelcontextprotocol/python-sdk/issues/3851
tools/list_changed never arrives from 2026-07-28 servers: goose does not open a subscriptions/listen stream aaif-goose/goose#13055https://github.com/aaif-goose/goose/issues/13055
Claude Codehttps://claude.ai/code
claudehttps://github.com/apps/claude
bughttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%22
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
on Nov 14, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3862#event-36140501419
https://github.com/Bensonluo
Bensonluohttps://github.com/Bensonluo
on Nov 14, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3862#issuecomment-6881918311
#3626https://github.com/modelcontextprotocol/python-sdk/pull/3626
@dcodehttps://github.com/dcode
https://github.com/Varshith-Kali
Varshith-Kalihttps://github.com/Varshith-Kali
on Nov 14, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3862#issuecomment-6882777464
https://github.com/media-ctrl
media-ctrlhttps://github.com/media-ctrl
on Nov 15, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3862#issuecomment-6898082708
Sign up for freehttps://github.com/signup?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3862
Sign in to commenthttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3862
bughttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%22
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.