Repository navigation
mcp: add per session list changed notifications - #1511
Open
nahapetyan-serob wants to merge 2 commits into
Open
nahapetyan-serob wants to merge 2 commits into
nahapetyan-serob wants to merge 2 commits into
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?
This branch has not been deployed
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