The 19-year-old made his first-team debut under Louis van Gaal this season and has gone on to make 12 appearances in all competitions.
"To make my debut for this great club earlier this season was a dream come true," McNair told the club's official website.
"I'm pleased to have signed a new contract. I have come through the academy here and I feel I am improving my game all the time with the help of the manager, the coaching staff and my team-mates."
Van Gaal was forced to throw McNair in at the deep end in September after his defensive options were severely limited due to multiple injuries but the United manager insists the centre-back can become a "top player".
"Paddy has risen through the ranks to become an integral part of the first team squad," said the Dutchman.
"He has all the attributes to develop into a top player. Promoting youth players is very important both to myself and to the club and I am delighted Paddy has signed a new contract."