Various pyrano[2,3-d]pyrimidines were synthesized by the multicomponent reaction of aldehydes, malononitrile, and acidic C–H compounds such as barbituric acid through the tandem Knoevenagel–Michael cyclocondensation pathway in an environmentally friendly reactive medium in the presence of a recoverable nanocomposite. This nanocomposite includes Fe3O4nanoparticles placed on an organometallic framework. The synthesized Fe3O4@iron-based metal–organic framework nanocomposite was characterized using scanning electron microscopy, energy dispersive X-ray spectroscopy, X-ray powder diffraction, a vibrating sample magnetometer, and thermogravimetric analysis.