Repository navigation
mcp: drop roots list_changed and standalone roots/list on 2026-07-28 - #1540
Conversation
There was a problem hiding this comment.
🟡 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.listChangedfrom modern client capabilities. - Rejects standalone
roots/listcalls 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
| return nil, &jsonrpc.Error{ | ||
| Code: jsonrpc.CodeMethodNotFound, | ||
| Message: fmt.Sprintf("%q is not supported in the new protocol", req.Method), |
There was a problem hiding this comment.
the error message should be more explicit about using the mrtr desgin
There was a problem hiding this comment.
the message doesn't reach to server anyway https://github.com/modelcontextprotocol/go-sdk/blob/main/internal/jsonrpc2/conn.go#L725C1-L726C1. So I suggest we drop the message, or refactor processResult (probably in a follow up PR)
There was a problem hiding this comment.
Right good catch, lets keep it as it is for now
| return nil, &jsonrpc.Error{ | ||
| Code: jsonrpc.CodeMethodNotFound, | ||
| Message: fmt.Sprintf("%q is not supported in the new protocol", req.Method), |
There was a problem hiding this comment.
Right good catch, lets keep it as it is for now

SEP-2575 removes
notifications/roots/list_changedand the standaloneroots/listrequest in protocol version 2026-07-28; servers read roots on demand through a multi round-tripListRootsRequest. On new-protocol sessions:notifications/roots/list_changed
Client.AddRootsandClient.RemoveRootsupdate the client's roots without notifying the server.rootscapability withoutlistChanged, which the 2026-07-28 schema no longer has.RootsListChangedHandlerfor an incoming notification. The existing check read the request's_meta, which notifications don't carry, so it never fired.notifications/initializedhad the same problem and is fixed the same way.roots/list
ServerSession.ListRootsrefuses to send a standaloneroots/list.roots/listwithCodeMethodNotFound.Behavior on older protocol versions is unchanged.