The fungus Claviceps purpurea produces highly toxic ergot alkaloids and accumulates these in the hardened bodies of fungal mycelium. These so-called sclerotia, or ergot bodies, replace the crop seed of infected plants, which can include numerous important food- and feedstuff such as rye and wheat. While several studies have explored details of the infection process and development of ergot bodies, little information is available on the spatial distribution of the mycotoxins in the sclerotia. Here we used matrix-assisted laser desorption/ionization mass spectrometry imaging (MALDI-MSI) at a lateral resolution of 35 μm to visualize the distribution of two representative alkaloids, ergocristine and ergometrine, produced by Ecc93 and Gal 310 variants of C. purpurea, respectively, after infection of rye. To improve cryosectioning of this fragile biological material tissue with complex texture, we developed a practical embedding protocol based on cellulose polymers. The MALDI-MS images recorded from the so produced intact tissues sections revealed that ergometrine exhibited a relatively homogeneous distribution throughout the ergot body, whereas ergocristine was found to be enriched in the proximal region. This finding can be correlated to the morphological development of sclerotia as ergot alkaloids are only produced in the sphacelial stage. The ability to localize toxins and other secondary metabolites in intact sections of crop-infecting fungi with high lateral resolution renders MALDI-MSI a powerful tool for investigating biosynthetic pathways and for obtaining a deeper understanding of the parasite-host interaction. Graphical abstract Workflow for identification and spatial localization of ergot alkaloids in infected rye grains.