In this paper, 5,10,15,20-tetrakis-(4-carboxyphenyl)porphyrin (TCPP) was used as the ligand, and metal Sn and Fe were used as the nodes to construct metal–organic framework (MOF) materials Sn-MOF and Sn-MOF@Fe3O4 with a three-dimensional structure. Both Sn-MOF and Sn-MOF@Fe3O4 were utilized for photocatalytic degradation of rhodamine B (Rh B) dye. The effects of catalyst dosage, initial pH of the reaction solution and H2O2 on the degradation of Rh B in water under different environments were investigated. The main active species during the photocatalytic reaction were identified by capture experiments. The results showed that Sn-MOF@Fe3O4 could effectively inhibit the complexation of electrons and holes, and exhibited high catalytic activity for Rh B at a catalyst concentration of 0.25 g/L and pH 3. The degradation efficiency reached 100 % after UV–Vis irradiation for 20 min and the performance of Sn-MOF@Fe3O4 for photocatalytic degradation of Rh B was superior to other photocatalysts.