MgB2 has been doped with 57Fe and 57Co in order to probe the electronic structure of the superconductor by Mössbauer spectroscopy. Simultaneous SEM–EDX studies showed that both Fe and Co were incorporated to some extent into the MgB2 host lattice. Mössbauer spectroscopy indicated that Fe2B and FeB were also formed during the preparation. At higher Fe contents Fe2B appeared unambiguously as a secondary phase in the x-ray diffraction. CoB was detected at substitution levels of 10 mol% and greater. Both Fe and Co doping decreased the Tc(0) modestly. Co and Fe were found to substitute at the Mg site in the MgB2 lattice. The Mössbauer parameters for 57Co and 57Fe were consistent with a metallic environment. The similarity of the isomer shifts in MgB2 and in cuprate superconductors is being discussed.