The 20-year-old broke into the first-team this year and made 16 appearances in his debut season for the club.
Van Gaal, who has a track record of promoting young talent, handed the Northern Irish defender his debut in a 2-1 victory over West Ham in September of last year.
McNair thanked the experienced Dutchman for giving him a chance in the first-team and backed himself to push on.
Speaking about last season, McNair said: “I love playing for Van Gaal, I really enjoy it and hopefully that will continue for many more years to come. When you see the young players he has given a chance to in the past at Ajax, Barcelona and Bayern Munich, it’s nice of him to show faith in me with a new contract.
“I quite enjoy playing both in midfield and defence, I’d be happy playing in either area of the pitch. I think I’m a ball-player rather than a ball-winner. I just love having the ball at my feet. I know I’m a centre-back but I love dribbling and I like trying to take people on. Centre-backs shouldn’t really be doing that but I do try. You see all the top teams like Barcelona playing out from the back — we are a top team too.
“Moving forward, I’d like to try and nail down a place in the United team, just try and play as many games as I can and hopefully the trophies come.”
United have a proud history of giving youngsters first-team opportunities so it is comforting to know that McNair is making strides under Van Gaal and that the manager trusts the player.
McNair had a good start to his career in the senior set up and will look to build on that next season with the chances that come his way. If United go through another injury crisis like they did last term, McNair provides a solid option as a backup.