Cocaine use disorder (CUD) is a global health problem with severe consequences, leading to behavioral, cognitive, and neurobiological disturbances. While consensus on treatments is still ongoing, repetitive transcranial magnetic stimulation (rTMS) has emerged as a promising approach for medication-resistant disorders, including substance use disorders. In this context, here we present the SUDMEX-TMS, a Mexican dataset from an rTMS clinical trial involving CUD patients. This longitudinal dataset comprises 54 CUD patients (including 8 females) with data collected at five time points: baseline (T0), two weeks (T1), three months (T2), six months (T3) follow-up, and twelve months (T4) follow-up. The clinical rTMS treatment followed a double-blinded randomized clinical trial design (n = 24 sham/30 active) for 2 weeks, followed by an open-label phase. The dataset includes demographic, clinical, and cognitive measures, as well as magnetic resonance imaging (MRI) data collected at all time points, encompassing structural (T1-weighted), functional (resting-state fMRI), and multishell diffusion-weighted (DWI-HARDI) sequences. This dataset offers the opportunity to investigate the impact of rTMS on CUD participants, considering clinical, cognitive, and multimodal MRI metrics in a longitudinal framework.