Skip to content

mcp: include resultType on new-protocol responses#1060

Merged
guglielmo-san merged 5 commits into
modelcontextprotocol:mainfrom
ychampion:fix-2026-result-type
Jul 13, 2026
Merged

mcp: include resultType on new-protocol responses#1060
guglielmo-san merged 5 commits into
modelcontextprotocol:mainfrom
ychampion:fix-2026-result-type

Conversation

@ychampion

Copy link
Copy Markdown
Contributor

Summary

  • Add resultType: "complete" to non-MRTR server result responses for 2026-07-28 requests.
  • Cover server/discover, list methods, and completion responses, and update expected conformance/example output.

Why

Fixes #1032. The 2026-07-28 schema requires resultType on 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

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 ./...
Comment thread mcp/server.go Outdated
Comment thread mcp/protocol.go Outdated
@ychampion ychampion force-pushed the fix-2026-result-type branch from ee4b0cf to 95e8252 Compare July 9, 2026 10:36
Comment thread mcp/server.go
ychampion and others added 2 commits July 10, 2026 13:04
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 guglielmo-san enabled auto-merge (squash) July 13, 2026 11:50
@guglielmo-san guglielmo-san merged commit dd79ca3 into modelcontextprotocol:main Jul 13, 2026
9 checks passed
guglielmo-san added a commit that referenced this pull request Jul 13, 2026
This PR adds the resultType in the troubleshoot doc after PR #1060
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.

2026-07-28 responses omit required resultType for most result types

2 participants