the Piper novels that manage to demonstrate that "good" and "Mary-Sue" can go together (at least if you're willing to turn the subgenre on its ear, and you have the chops to pull it off)
I still say the Piper novels aren't in the Mary Sue genre, they're in the "Lower Decks" genre. They were the first attempt to tell a
Star Trek story from the perspective of junior officers on the
Enterprise rather than the TV leads, as well as the first attempt to do one in the first person. A Mary Sue is a nominal guest character who overshadows the characters who should be the leads, because the leads are written out of character to weaken them. But in the Piper novels, Piper, Sarda, Scanner, and Merete are the lead characters and Kirk, Spock, McCoy, etc. are the supporting characters. And yet Kirk, Spock, etc. are consistently five steps ahead of Piper and her hapless gang. If anything, Kirk is the Mary Sue in Piper's story. (Although Piper does take on some Sue-ish qualities in the sequel, with how quickly she ends up in Kirk's inner circle, as well as playing a key role in exposing a
second galactic conspiracy in as many months.)
Generally, though, the term "Mary Sue" is misunderstood. It wasn't meant to refer to
any story that focused on an impressive guest character -- after all, guest-centric storytelling was commonplace in '60s and '70s TV, and TOS did its share of episodes that centered heavily on the guests (e.g. "Where No Man," "Mudd's Women," "Charlie X," etc.). Mary Sue stories are examples of that approach done
badly, where the guest characters are just authorial self-insertions that aren't really good or interesting enough to drive a story and are made impressive only by diminishing the surrounding characters. So, yes, absolutely there are good guest-centric stories, but I don't agree that they should be called Mary Sue stories. Especially since far too many people these days just use it as a sexist label for any prominent female character. That usage has tainted it to the point that it should probably be abandoned altogether.