Motivated by recent experimental progress towards the detection and manipulation of Majorana fermions in ferromagnetic atomic chains on a superconductor, we present a novel proposal based on a single-crystal diamond (SCD) microcantilever with a single nitrogen-vacancy (NV) center spin embedded in ultrapure diamond substrate to probe Majorana fermions in an all-optical domain. With this scheme, a possible distinct Majorana signature is investigated via the electron spin resonance spectrum. In the proposal, the SCD microcantilever behaves as a phonon cavity and is robust for detecting of Majorana fermions, while the NV center spin can be considered as a sensitive probe. Further, the vibration of the microcantilever will enhance the coupling effect, which makes the Majorana fermions more sensitive to detection and the well-established optical NV spin readout technology will certainly promote the detection. This proposed method may provide a potential supplement for the detection of Majorana fermions.