These results shed light on the potential of SHMT as an antibacterial target and support the development of SHMT inhibitors as therapeutic agents for bacterial, viral and parasite infections and cancer. Here, SHMT2 is linked to cancer.