Aims. We explore the possibility that the stellar relative abundances of different species can be used to constrain the bulk abundances of known transiting rocky planets. Methods. We use high resolution spectra to derive stellar parameters and chemical abundances for Fe, Si, Mg, O, and C in three stars hosting low mass, rocky planets: CoRoT-7, Kepler-10, and Kepler-93. These planets follow the same line along the mass-radius diagram, pointing toward a similar composition. The derived abundance ratios are compared with the solar values. With a simple stoichiometric model, we estimate the iron mass fraction in each planet, assuming stellar composition. Results. We show that in all cases, the iron mass fraction inferred from the mass-radius relationship seems to be in good agreement with the iron abundance derived from the host star's photospheric composition. Conclusions. The results suggest that stellar abundances can be used to add constraints on the composition of orbiting rocky planets.