We developed an electrochemical copper sensor that was constructed by a modified carbon paste electrode with Fe3O4 mesoporous nanoparticles and multiwall carbon nanotubes. The Fe3O4 nanoparticles with sizes of 24–36 nm were synthesized by a hydrothermal method. The size and morphology of the nanoparticles were investigated by SEM, TEM images and X-ray diffraction patterns, and the results showed cubic shaped nanoparticles with porous structure. The Nitrogen adsorption − desorption isothermal measurements indicated that the prepared nanoparticles had two types of pore sizes of 4 nm and about 20 nm. The FT-IR spectroscopy revealed that the indigo carmine (IC) dye had a high tendency toward the as-synthesized nanoparticles through hydrogen bonding. The voltammetric techniques were employed to investigate the IC redox behavior and the complex formation between Cu2+ and IC. The decrease of IC oxidation peak, along with an obvious anodic shift potential, was observed because of the complex formation between IC and Cu2+.