mcp: include resultType on new-protocol responses#1060
Open
ychampion wants to merge 4 commits into
Open
Conversation
Wrap non-MRTR server result objects for 2026-07-28 requests so the wire response includes resultType without changing direct marshaling of public result structs. Fixes modelcontextprotocol#1032 Constraint: Preserve existing public result struct shape and direct JSON output for callers. Tested: go test ./mcp -run 'Test(ServerSessionHandle|CompleteResult|ClientConnectDiscover|InMemory_E2E_Discover)' -count=1; go test ./mcp -count=1; go test ./...
ee4b0cf to
95e8252
Compare
Constraint: MRTR responses must retain input_required instead of receiving the generic complete discriminator. Tested: go test ./mcp -run TestServerSessionHandle_SetsResultTypeOnNewProtocol -count=1; go test ./...; go vet ./...
guglielmo-san
approved these changes
Jul 10, 2026
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.
Summary
resultType: "complete"to non-MRTR server result responses for 2026-07-28 requests.server/discover, list methods, and completion responses, and update expected conformance/example output.Why
Fixes #1032. The 2026-07-28 schema requires
resultTypeon result objects, but only the MRTR-capable results were setting it.Validation
go test ./mcp -run 'Test(ServerSessionHandle|CompleteResult|ClientConnectDiscover|InMemory_E2E_Discover)' -count=1— passed\n-go test ./mcp -count=1— passed\n-go test ./...— passed\n-go vet ./...— passed