A Mary-Sue is an over-idealised fictional character that exists as an extension of the writer’s wish-fulfilment and ego drives. Despite all the talents and powers of the rest of the cast, Mary-Sue still somehow manages to be the crucial lynchpin in every situation, solving all the problems, directing the action, and totally overshadowing every other character. Ultra-competence on a character’s part is a symptom of possible Mary-Sue contamination, but it is not a definitive mark. S/he has no real flaws, is adored by all characters, frequently makes flagrant use of deus ex machina, and may share physical traits, tastes or names with the author. Generally, the presence of Mary-Sue will pretty much destroy the story.
A Mary-Sue character is usually the mark of a naive or inexperienced writer. The term originates from fan-fiction, in which enthusiasts write amateur stories based in the worlds they love. There’s plenty of great fan-fiction of course, but many Mary-Sue characters literally are the author as she dreams of being, dropped into the pre-existing cast of a story setting. The name comes from Paula Smith’s cutting 1973 parody of bad Star-Trek fan fiction, “A Trekkie’s Tale”.