MoS2 and related transition metal dichalcogenides (TMDs) have recently been reported as having extensive applications in nanoelectronics and catalysis because of their unique physical and chemical properties. However, one practical challenge for MoS2-based applications arises from the easiness of oxygen contamination, which is likely to degrade performance. To this end, understanding the states and related energetics of adsorbed oxygen is critical. Herein, we identify various states of oxygen species adsorbed on the MoS2 surface with first-principles calculations. We reveal a "dissociative" mechanism through which a physisorbed oxygen molecule trapped at a sulfur vacancy can split into two chemisorbed oxygen atoms, namely a top-anchoring oxygen and a substituting oxygen, both of which show no adsorbate induced states in the bandgap. The electron and hole masses show an asymmetric effect in response to oxygen species with the hole mass being more sensitive to oxygen content due to a strong hybridization of oxygen states in the valence band edge of MoS2. Alteration of oxygen content allows modulation of the work function up to 0.5 eV, enabling reduced Schottky barriers in MoS2/metal contact. These results show that oxygen doping on MoS2 is a promising method for sulfur vacancy healing, carrier mass controlling, contact resistance reduction, and anchoring of surface electron dopants. Our study suggests that tuning the chemical composition of oxygen is viable for modulating the electronic properties of MoS2 and likely other chalcogen-incorporated TMDs, which offers promise for new optoelectronic applications.