diff --git a/mcp/server.go b/mcp/server.go index adcf698f..912dea98 100644 --- a/mcp/server.go +++ b/mcp/server.go @@ -1558,11 +1558,7 @@ func (ss *ServerSession) handle(ctx context.Context, req *jsonrpc.Request) (any, if perRequestErr != nil { return nil, perRequestErr } - // server/discover is exempt from the version-validation gate so that a - // client probing with a version the server doesn't implement can still - // learn the server's supported versions from the response (whether the - // handler returns a DiscoverResult or an UnsupportedProtocolVersionError - // with a Data.Supported payload). + if validatedMeta.usesNewProtocol && !slices.Contains(supportedProtocolVersions, validatedMeta.initializeParams.ProtocolVersion) { data, _ := json.Marshal(UnsupportedProtocolVersionData{