1) She supports John when Sherlock can’t
When Sherlock was away dismantling Moriarty’s network, Mary was there for John. She accompanies him to Sherlock’s grave and she writes encouraging messages on his blog when he’s attacked by trolls. When Sherlock is leaving for undercover work and never coming back, she promises that she will take care of John for Sherlock, and stands by John’s side once again.
2) She brings Sherlock and John back together and helps them maintain their friendship
When John is absolutely furious with Sherlock, Mary is the one that listens to Sherlock’s explanation. Mary decides to help talk John around, and it works. At no point does she demand that John not make her compete with Sherlock for his attention. She recognizes that they need to spend time together, and so she takes it upon herself to make sure that they do.
3) She understands Sherlock’s emotional state, even better than John
Mary is the first to realize that Sherlock didn’t really understand what he did wrong by faking a suicide in front of John and then surprising him out of the blue. She is the one to notice how nervous the wedding is making Sherlock, not John. Mary can spot when he’s lying, and knows when he’s jealous, none of which John can do.
4) She acts as a moral compass for John
John is the one who points out when Sherlock is doing something wrong. He is the one to explain when the way Sherlock is treating people is, “not good.” Mary does the same for John. She calls him out for his dismissive and rude treatment of their neighbor, and remembers social niceties when John can’t be bothered. Mary is the one to point out there is something off about the way he’s acting.
5) The Little Things
Mary recognizes the skip code and runs to Sherlock so that they can save John. Mary is the one that remembers the details that help Sherlock and John save Major Sholto. She is the one to try to include Sherlock in their wedding celebration. She is the one John can confide in about Major Sholto.
So the idea that Mary has done nothing for either Sherlock or John is ridiculous. She has been invaluable to them since her first comment on John’s blog.
When John marries Mary, who they think is boring and nothing like Sherlock, they complain.
When they find out that Mary was actually an assassin and not boring at all, they still complain.