We describe an integrated real-time sensing and control system for monitoring and controlling substrate temperature, layer composition, and effusion cell flux during molecular beam epitaxial growth of HgCdTe epilayers for advanced IR detectors. Substrate temperature is monitored in real-time using absorption-edge spectroscopy, allowing the temperature to be controlled within 1.5 degrees C of the desired setpoint. lit situ spectroscopic ellipsometry (SE) is used for monitoring HgCdTe layer composition in real-time. A comprehensive temperature- and composition-dependent dielectric function database has been recorded which allows the accurate and precise determination of Hg1-xCdxTe layer composition over a wide range of x-values, from 0.2 to 0.42. The composition changes inferred from real-time SE measurements obtained during growth of a two-layer structure are in excellent agreement with composition profiles obtained using postgrowth secondary ion mass spectroscopy analysis. The accuracy and precision of SE measurements conducted over multiple growth runs are shown to be suitable for robust SE-based composition control. Changes in the Cd flux produced by a CdTe effusion cell are detected using an atomic optical absorption method. This method allows changes in HgCdTe layer composition to be correlated directly with variations in Cd flux. All of the in situ sensors are linked using a custom software framework to provide the foundation for real-time monitoring and control of HgCdTe MBE growth of high performance infrared detector structures over a wide range of compositions, layer thicknesses, and substrate temperatures.