Mordenkainen is an archmage from the Greyhawk setting, and technically that setting's equivalent of Elminster: he's an avatar of Gary Gygax as much as Elminster is one for Ed Greenwood, though the judgement is still out on that one; Elminster has never done a single thing wrong and never will as far as Greenwood is concerned, whereas Gygax actually seemed to acknowledge at some points that Mordy is a bit of a dickbag and it was TSR who made Mordenkainen a Mary Sue. Mordy is famous as the head-asshole-in-charge of the Circle of Eight, a group of archmages who mostly serve him as grunt-labor for Mordy's plans, and is an old adventuring buddy of Iggwilv, Murlynd and Zagyg.
While some of the ancient neckbeards of D&D still talk lovingly of Mordenkainen, the plain and ugly truth is that he's a giant fucking shitbag of the highest order. In contrast to their creators' responses, Elminster seems to be the less harmful in-universe. While Elminster is a creeper (and, arguably, a closet pedo), he at least knows that Evil is bad and will get off his wrinkled balls and do something positive for the world once in a while without fucking over a lot of people in the process. By contrast, Mordenkainen deliberately fucks everyone over, just to maintain his "enforced neutrality" philosophy. That said, he's good at making spells, but bad in politicking and maintaining neutrality in Greyhawk.
Mordy, according to various sources, seems to have been born around 509 CY and spent his younger days around the Wild Coast (wedged south of the City of Greyhawk, north of the Pomarj). He founded a group called the Citadel of Eight, in 561, named for having eight members: himself, Bigby, Robilar, Yrag, Riggby, Serten, Otis, and Tenser. The idea was simply to place a big fucking stronghold in a place where adventure would be within easy reach no matter which direction they headed in. Then the Battle of Emridy Meadows happened; Serten died, and it exposed deep ideological differences between the members, so they fucked off to do whatever.
Mordy, not hearing a fucking thing Tenser tried to tell him about how stupid he was being, forged on ahead with a newer-and-better Circle of Eight in 571, comprised only of wizards. Things weren't so bad for a while, this time; they mostly all just kind of screwed around with their own projects and Mordy kept thinking everything was going Just As Planned. Then, Vecna, showing Mordy what actual cunning and guile looks like, used some throwaway minion to murder the entire fucking Circle. No, seriously, eight fucking arch-wizards were taken out by what was basically a henchman. Mordy, being the "shadow" ninth member, wasn't there when it happened (a recurring theme with Mordy, never being where the actual action happens), and put together a group to go retrieve pieces of his "friends" (really, he treats them like minions, but whatever helps him sleep at night I guess), and use the wizard spell clone to put them back together.
Bad news for Mordy, though, was that this might have been a cover for the start of the infamous Greyhawk Wars. It wasn't called that because any fighting actually happened in that city; the war consumed most of the Flanaess region, and Greyhawk was where they signed the treaty ending it. Apparently Mordy didn't want to bother risking his own neck doing much about Iuz, Ivid, and the other dozen or so villains running around and ruining (almost literally) everything, so he decided to hide out in the Obsidian Citadel to grow some friends.
After he grows back all the wizards, he realizes he fucked up and missed the actual threat to stability for things, and gets his
minions friends working to stop the fighting. What he doesn't realize is that his former bestie Rary has been having some second thoughts about Mordy's plans and schemes, or that Robilar got his dumb ass zapped by a magic mirror in the ruins of Castle Greyhawk, which replaced him with Bilarro (and I'll give you two guesses whether or not the mirror-universe version was evil). So Rary gets with "Robilar" and orchestrates the utter and total betrayal of the Circle one last time. "Robilar" takes the best soldiers he can to raid all the hiding spots for the other wizards' clones (kept in storage in case they got killed again), while Rary fucks around in Greyhawk trying to create a fuckhuge magic trap to kill all the ambassadors and diplomats trying to end all the fighting. Otiluke and Tenser stumble on Rary, and a major, vicious magic fight breaks out, killing both of the good mages. Rary and "Robilar" fuck off to the Bright Desert to pat themselves on the back for at least destroying two of their enemies once and for all (though not really; Tenser learned not to depend on Mordy or anyone else for that matter and made a backup-backup clone on the moon).
Now, any savvy person might have thought Mordy would say, "You know what? I fucking give up. I clearly have underestimated how powerful Evil will get if given even half an opportunity. I should stop being Stupid Neutral and try something else." But no! Mordy doubles down, recruiting three more fucking dupes into signing on for the shitshow that the Circle of Eight has become at this point (since Rary had fucked them over, Otiluke was dead, and Tenser wisely refused to work for an asshole like Mordy).
Since then, Mordy seems to realize how he should fuck off and stop doing things. He only appears in 3.5 in Expedition to Castle Greyhawk to fix the Robilar/Bilarro situation. In 4E, he appears in Mordenkainen's Magnificent Emporium to tell everyone how bad it is for you to have magic items, nevermind that he owns fucking dozens of them, including possibly various artifacts.
5E seems to be giving him more of a showing. In Curse of Strahd, he apparently is trapped by the "dark powers" of Barovia to fight against Strahd; the vampire, showing himself to be one of the true badasses of D&D, defeats Mordy and throws his ass off a cliff. Mordy goes a touch insane, and may or may not be helpful. Later, in the Forgotten Realms novel, 'Death Masks', he is directly referred to being in the care of Elminster and Storm Silverhand, trying to help him recover from his madness. (Ed Greenwood marty stue nonsense). Later, he sends a Simulacrum to Avernus to keep an eye on a massive push by the forces of the Abyss to conquer the first level of Hell, and can help the party if they play nice. He even got his own book, where alongside the monster stats and planar lore, we get to hear his philosophical insights and his racism towards halflings. No, really.
One wonders if maybe Strahd and Vecna could put any possible differences aside and just go take Mordy out once and for fucking all, so we won't have to hear about any more of his failures. Bonus points if Dalamar from Dragonlance - one of Mordenkainen's supposed peers that he used to chat with (in the old Dragon "Wizards Three" articles) - would step in to deliver the killing blow and/or keep Elminster out of it.
Aside from completely being a fuck-up who can't seem to learn that he's bad at being some kind of quasi-political mastermind, Mordy has, in point of fact, created some very useful spells. The Mordenkainen's disjunction, Mordenkainen's magnificent mansion, and Mordenkainen's private sanctum spells are three of the most clutch spells for big-time wizards: the first one can break almost any magic in the game (even a slim chance to break artifacts), the second is essentially an hours-long buffet and resting area that nobody can get into, and the last one provides (potentially permanent) protection against scrying and mind-reading. He's got a few other spells, though most aren't hugely useful, though Mordenkainen's capable caravel is basically the god-mode way to travel when you don't have an airship since it's a self-propelled magnificent mansion in ship form.