We have investigated the feasibility of Mg doping using bis-cyclopentadienyl magnesium (Cp2Mg) during growth of InP and InGaAs by metalorganic molecular beam epitaxy. In InP, hole concentrations between 5X10(16) and 4X10(18) cm-3 were readily attained without degradation of the surface morphology. Comparison with secondary ion mass spectrometry analysis shows good electrical activation for concentrations less-than-or-equal-to 2X10(18) cm-3 though compensation at low doping levels was observed due to compensation from carbon and oxygen impurities which were present at levels of 9X10(16) and 5x10(16) cm-3 , respectively. Mg profiles in InGaAs tended to be more abrupt than those in InP and hole concentrations up to 10(19) cm-3 were achieved. p-InGaAs/n-InP structures annealed at 600-degrees-C for 10 s showed no evidence of Mg diffusion.