Fe3O4 magnetic nanoparticles were synthesized by co-precipitation of Fe2+ and Fe3+ in aqueous NaOH. Then silica was coated on the obtained nanoparticles and the whole composite was functionalized with chlorosulfonic acid in CH2Cl2. The obtained nanocomposite (Fe3O4@SiO2-SO3H) was characterized by FT-IR, VSM and XRD techniques and was used as an efficient catalyst in condensation reaction of indoles and aldehydes, and excellent yields of the desired products were obtained. The catalyst was recycled and used for successive runs with no considerable loss of activity. The indole products in their conjugated form were capable of selective sensing of CN- anion in solution.