She started out as a character on the actual series, and was turned into a Mary Sue in fanfic.
Amanda Rogers originally appeared in the episode "True Q", where she learned that she belongs to the Q Continuum, which give her a terrible ultimatum - give up her powers, or be killed. The Q continuum is what killed her parents. Nice...
In the series, she is gone after that episode ends, because of Q.
Fanfiction re-writes things, and here's how Amanda's story plays out.
Information by Pat Pflieger
In the story, Kathryn Janeway is depressed after Tuvok's death; Amanda, who has been watching the ship, gives her a small break from the stress.
Introducing herself as "Mary Sue Q", Amanda is very funny and perceptive about herself and the men of Trek; Janeway heartily enjoys her stories of their seduction. Amanda comforts Janeway further by taking her back to the time of Tuvok's death, so he can transfer his katra to her; she will take it back to Vulcan.
Amanda Rogers finds Kathryn Janeway mourning Tuvok's death in the Delta Quadrant and literally takes her away for a much-needed break from her responsibilities and grief.
In a funny and perceptive scene, "Mary Sue Q" Amanda Rogers -- an established character who learned that she is part of the omnipowerful Q Continuum -- explains to Kathryn Janeway her studied seduction of some famous Starfleet figures, starting with James T. Kirk: "I came onto his ship as Ensign Mary Sue Johnson, and, through a series of events that I created, managed to save the Enterprise from certain destruction. Of course, I did it without looking too powerful, just lucky. Anyway, he was so grateful, that seducing him was easy. ... I was a bold adventuress for Jean-Luc Picard, an intellectual for Christopher Pike, a noble Romulan soldier for this fascinating Romulan commander ... a warrior princess for Will Riker ... and of course, a Vulcan priestess for Mr. Spock. That was one of my greatest triumphs. Of course I had to induce Pon Farr ...."
Having seduced James T. Kirk, Amanda Rogers conscientiously kills off her Mary Sue character "just when [Kirk] would have begun to get restless"; the grieving Kirk is "secretly relieved that she was reduced to an icon he could mourn rather than a real flesh and blood woman that he would have to deal with."
Adorable and omnipowerful Amanda Rogers, who learns that she is a member of the Q Continuum in the TNG episode "True Q," has had the name Mary Sue "ascribed to me so many times that I feel comfortable with it,"
Mary Sue Page