Brain-controlled neuromodulation has emerged as a promising tool to promote functional recovery in patients with motor disorders. Brain-machine interfaces exploit this neuromodulatory strategy and could be used for restoring voluntary control of lower limbs. In this work, we propose a non-invasive brain-spine interface (BSI) that processes electroencephalographic (EEG) activity to volitionally control trans-spinal magnetic stimulation (ts-MS), as an approach for lower-limb neurorehabilitation. This novel platform allows to contingently connect motor cortical activation during leg motor imagery with the activation of leg muscles via ts-MS. We tested this closed-loop system in 10 healthy participants using different stimulation conditions. This BSI efficiently removed stimulation artifacts from EEG regardless of ts-MS intensity used, allowing continuous monitoring of cortical activity and real-time closed-loop control of ts-MS. Our BSI induced afferent and efferent evoked responses, being this activation ts-MS intensity-dependent. We demonstrated the feasibility, safety and usability of this non-invasive BSI. The presented system represents a novel non-invasive means of brain-controlled neuromodulation and opens the door towards its integration as a therapeutic tool for lower-limb rehabilitation.