Sketch of the proposed setup for optically detecting MFs. An InSb semiconductor nanowire (SNW) with strong spin-orbit interaction (SOI) in an external aligned parallel magnetic field B is placed on the surface of a bulk s-wave superconductor (SC). The two green stars at the ends of the nanowire represent a pair of MFs. The nearby MF is coupled to a semiconductor QD embedded in a nanomechanical resonator under a strong pump laser and a weak probe laser simultaneously. The inset is an energy-level diagram of a semiconductor QD coupled to MFs and NR.