Control of the work function of molybdenum disulfide (MoS2) under ultrathin metal was investigated using in situ metal deposition and direct ultraviolet photoelectron spectroscopy measurement in an ultra-high vacuum system. When the metal thickness turned from two dimensional into bulk, the work function was also raised up at the nickel-MoS2 interface, barely changed at the titanium-MoS2 interface and lowered at the hafnium-MoS2 interface. Meanwhile, the mechanisms of charge transfer and band alignment with metal deposition were also discussed. The Schottky barrier at metal-MoS2 interfaces could be tailored by both types and thicknesses of deposited metal. The low work function metal was a good indicator for MoS2 contact electrodes. It paved the way towards future high performance MoS2 device applications.