Repository navigation
mcp: add per session list changed notifications - #1511
Merged
guglielmo-san merged 4 commits intoNov 9, 2026
Merged
Conversation
chrikrah
approved these changes
Nov 8, 2026
chrikrah
left a comment
There was a problem hiding this comment.
@nahapetyan-serob nothing here blocks a merge from my side. With notifyListChanged stubbed to return nil, both new tests fail.
non-blocking: deleting server.go:1749 (ctx := context.WithValue(ctx, idContextKey{}, id)) keeps all of ./mcp green. Only Streamable HTTP routes by that ID (streamable.go:2093), and the tests use in-memory transports. Without it, a notify from inside a tool handler would go out on the tool call's stream, not the listen. A Streamable HTTP test that notifies from a handler would pin it.
$ go test ./... -count=1 # 4325744, go1.27.3 darwin/arm64, GOTOOLCHAIN=local
ok github.com/modelcontextprotocol/go-sdk/mcp 39.043s
(all 14 packages ok; go vet ./mcp clean)
$ (notifyListChanged returning nil first) go test ./mcp -run TestNotifyListChanged -count=1
--- FAIL: TestNotifyListChanged_OnlyChosenSession (15.01s) # tool, prompt, resource
--- FAIL: TestNotifyListChanged_WhenSent (5.11s) # legacy
$ (server.go:1749 replaced by `_ = id`) go test ./mcp -count=1
ok github.com/modelcontextprotocol/go-sdk/mcp 36.084s
# not run: a real HTTP client against a listen stream
Can that test go in with this PR?
…thub.com:modelcontextprotocol/go-sdk into serob/add-per-session-list-changed-notifications
Contributor
Author
|
Thanks @chrikrah, added |
guglielmo-san
approved these changes
Nov 9, 2026
guglielmo-san
deleted the
serob/add-per-session-list-changed-notifications
branch
November 9, 2026 13:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #1480