We theoretically study a one dimensional p-wave superconducting mesoscopic ring interrupted by a weak link and coupled inductively to a microwave cavity. We establish an input-output description for the cavity field in the presence of the ring, and identify the electronic contributions to the cavity response and their dependence on various parameters, such as the magnetic flux, chemical potential, and cavity frequency. We show that the cavity response is 4π periodic as a function of the magnetic flux in the topological region, stemming from the so called fractional Josephson current carried by the Majorana fermions, while it is 2π periodic in the non-topological phase, consistent with the normal Josephson effect. We find a strong dependence of the signal on the cavity frequency, as well as on the parity of the ground state. Our model takes into account fully the interplay between the low-energy Majorana modes and the gaped bulks states, which we show is crucial for visualizing the evolution of the Josephson effect during the transition from the topological to the trivial phase.