This is a simple piece of javascript (licensed under the MIT license) by Alexander Pruss that splits an STL mesh file that contains multiple parts into those multiple parts.
This may well fail if the mesh is defective and has points that are meant to be coincident but are merely close together.
All the processing is done in your browser--your STL is not uploaded to any server.