In the current work, to synthesize a magnetic polymer-based nanocatalyst, poly (styrene-co-maleic anhydride) (PSMA) was modified by melamine as a crosslinking agent (MPSMA). Then, MPSMA was sulfonated by the re-action with chlorosulfonic acid (SMPSMA), and then the magnetic nanocomposite was prepared via the in-situ coprecipitation method (SMPSMA@Fe3O4). The SMPSMA@Fe3O4 nanocatalyst was characterized by employ-ing FTIR, CHNSO, EDX, VSM, XRD, SEM, and TG analyses. The catalytic activity of the nanocatalyst was examined in the synthesis of pyrano[3,2-c]chromens, pyrano[2,3-c] pyrazoles, and benzyl pyrazolyl coumarins. Taking 0.06 g of nanocatalyst in 50 min at reflux temperature in water/ethanol as a green solvent, the greatest output of pyrano[3,2-c]chromens, pyrano[2,3-c] pyrazoles, and benzyl pyrazolyl coumarins were synthesized 85-94 %, 85-94 %, and 92-96 % respectively. The key advantages of the current technique are its simple re-action conditions, straightforward isolation of the products, straightforward magnetic separation, and reusability of the catalyst with minimal activity loss.