The exchange coupling between magnetic adsorbates and a superconducting substrate leads to Shiba states inside the superconducting energy gap and a Kondo resonance outside the gap. The exchange coupling strength determines whether the quantum many-body ground state is a Kondo singlet or a singlet of the paired superconducting quasiparticles. Here we use scanning tunnelling spectroscopy to identify the different quantum ground states of manganese phthalocyanine on Pb(111). We observe Shiba states, which are split into triplets by magnetocrystalline anisotropy. Their characteristic spectral weight yields an unambiguous proof of the nature of the quantum ground state. Our results provide experimental insights into the phase diagram of a magnetic impurity on a superconducting host and shine light on the effects induced by magnetic anisotropy on many-body interactions.