Being a female myself, I have always written from the female perspective--because it's what I know. My MC is always a girl. When I was younger however, I used to want to show what everyone in the story felt, so I would end up writing from ALL character perspectives--male, female, animal, creature...you name it.
Eventually I just stuck with the female POV because it made sense. But I like to know what everyone else is thinking too--especially the male MC and particularly if he is the love interest of my female MC. I always imagine how things are on his end of the spectrum in vivid detail, because even though readers aren't seeing things as they progress in his mind, I want them to be able to understand his actions and reactions.
It's not necessary to make your MC the same gender as you in order to write a good book. Look at J.K. Rowling. Harry Potter anyone? How about E.B. White and Charlotte's Web? Or A Thousand Splendid Suns by Khaled Hosseini. Also Frankenstein by Mary Shelley.
I think you should be able to write from any perspective as long as you understand your character and know what it is you want to convey to your reader.
I am curious to know whether your MC is a male or female. From what perspective do you write and why did you choose the same or opposite of what you are? Which is easier for you?