The 44-year-old has excelled in the role for Ospreys since 2006, helping guide the side to three PRO12 titles and one Anglo-Welsh Cup crown.
Humphreys will join Scott Johnson's backroom team on a two-year contract ahead of the quadrangular tournament with Samoa, South Africa and Italy in June.
Humphreys, who has agreed a two-year contract, added: "I'm very excited by the challenge of working with the Scotland players and management and building on the very solid foundations that are in place.
"I know Scott Johnson well from our time together at the Ospreys and it will be great to renew acquaintance with a man who has such a sharp rugby brain.
"It's with a heavy heart that I am leaving the Ospreys after eight years. I would like to take this opportunity to thank the Ospreys for everything that they have done for me. They gave me the opportunity to coach at the top level."
Scottish Rugby chief executive Mark Dodson said: "Jonathan impresses us. He's a very astute coach and when you look at the players he has nurtured to the very highest levels of the game then clearly he has much to offer."