Single molecule magnets and single spin centres can be individually addressed when coupled to contacts forming an electrical junction. To control and engineer the magnetism of quantum devices, it is necessary to quantify how the structural and chemical environment of the junction affects the spin centre. Metrics such as coordination number or symmetry provide a simple method to quantify the local environment, but neglect the many-body interactions of an impurity spin coupled to contacts. Here, we utilize a highly corrugated hexagonal boron nitride monolayer to mediate the coupling between a cobalt spin in CoHx (x=1,2) complexes and the metal contact. While hydrogen controls the total effective spin, the corrugation smoothly tunes the Kondo exchange interaction between the spin and the underlying metal. Using scanning tunnelling microscopy and spectroscopy together with numerical simulations, we quantitatively demonstrate how the Kondo exchange interaction mimics chemical tailoring and changes the magnetic anisotropy.