Firstly, a master's degree is not proper and therefore does not require capitalization, but personally I've seen several highly professional institutions spell it both ways.
Seeing as how all three of those sentences are grammatically sound, it's more a question of etiquette or regional custom. Like Peter Shor was saying, it's not wrong to say that you took your master's degree in somewhere but you may have to use caution repeating prepositions.
e.g. I took my master's degree in astrophysics in the University of Somewhere
Using in twice is potentially awkward in situations where you may need to elaborate on your area of study.
To answer your question, all of those examples are grammatically strong and should get the message across appropriately anywhere you go.
On an editorial note, however, there are some ways to bypass this dilemma by opting for more colorful words:
I (received, earned, attained) a master's degree after (studying in/at, attending, graduating from) the University of Somewhere.
Play it right and you'll sound like a Nobel Laureate, but all of your sentences will work well; none of them is really noticeably better, even on paper.