Skip to content

mcp: drop roots list_changed and standalone roots/list on 2026-07-28 - #1540

Open
nahapetyan-serob wants to merge 1 commit into
mainfrom
serob/drop-notifications/root/list_changed-and-standalone-roots/list
Open

nahapetyan-serob wants to merge 1 commit into
mainfrom
serob/drop-notifications/root/list_changed-and-standalone-roots/list

Conversation

@nahapetyan-serob

Copy link
Copy Markdown
Contributor

SEP-2575 removes notifications/roots/list_changed and the standalone roots/list request in protocol version 2026-07-28; servers read roots on demand through a multi round-trip ListRootsRequest. On new-protocol sessions:

notifications/roots/list_changed

  • Added: Client.AddRoots and Client.RemoveRoots update the client's roots without notifying the server.
  • Added: the client declares the roots capability without listChanged, which the 2026-07-28 schema no longer has.
  • Fixed: the server no longer calls RootsListChangedHandler for an incoming notification. The existing check read the request's _meta, which notifications don't carry, so it never fired. notifications/initialized had the same problem and is fixed the same way.

roots/list

  • Already handled: ServerSession.ListRoots refuses to send a standalone roots/list.
  • Added: the client rejects an incoming standalone roots/list with CodeMethodNotFound.

Behavior on older protocol versions is unchanged.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Stateless HTTP still dispatches notifications/roots/list_changed for protocol version 2026-07-28 because temporary sessions lack a recorded version and the suppression check does not fall back to the HTTP header.

1 open issue
What changed in this PR

Updates the Go SDK’s roots handling for protocol version 2026-07-28, moving modern sessions toward on-demand, multi-round-trip roots requests while preserving legacy behavior.

Changes:

  • Suppresses roots-change notifications and omits roots.listChanged from modern client capabilities.
  • Rejects standalone roots/list calls on modern clients and filters removed notifications on servers.
  • Adds protocol-specific tests and updates documentation and expected example output.
File Description
mcp/​transport_example_test.go Updates expected discovery output to advertise roots: {}.
mcp/​server.go Filters removed notifications using the session protocol version.
mcp/​server_test.go Tests roots-change notification handling across protocol versions.
mcp/​client.go Applies version-specific roots capabilities, notification filtering, and request rejection.
mcp/​client_test.go Tests modern capabilities and standalone roots request rejection; pins legacy cases.
mcp/​capabilities_test.go Checks sent and received roots notifications by protocol version.
internal/​docs/​client.src.md Documents modern roots behavior in the documentation source.
docs/​troubleshooting.md Updates the generated logging example’s expected capabilities.
docs/​client.md Includes the generated explanation of modern roots behavior.

Review effort: Balanced

Comment thread mcp/server.go
}
}
case notificationInitialized, notificationRootsListChanged:
if ss.protocolVersion() >= protocolVersion20260728 {

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants