The X-shooter Spectral Library (XSL) is a large empirical stellar library used as a benchmark for the development of stellar population models. The inclusion of alpha-elements abundances is crucial to disentangling the chemical evolution of any stellar system. This paper provides a catalogue of high-precision and accurate magnesium and calcium abundances from a wide variety of stars well distributed in the Hertzsprung-Russell (HR) diagram. We originally performed an analysis of the derived Mg and Ca abundances for medium-resolution spectra from the XSL Data Release 2. For this purpose, we used the GAUGUIN automated abundance estimation code to fit the ultraviolet-blue (UVB) and visible (VIS) spectra. We tested the consistency of the atmospheric parameters and chemical abundances with the Gaia DR3 and the AMBRE Project datasets.We have obtained precise [Mg/Fe] and [Ca/Fe] abundances for 192 and 217 stars respectively, from which 174 stars have measurements in both elements. The stars cover a broad range of effective temperature 4000