This paper presents a novel tunable narrowband photodetector based on Ag-MgF2-Ag (metal-dielectric-metal: MDM) Fabry-Perot (FP) microcavity structure. The tunability is achieved through precise adjustment of the thickness of the metal and intermediate dielectric layers of the FP microcavity, taking into account the response spectral range of planar perovskite. After optimizing the parameters mentioned above, the prototype devices were prepared by combining the perovskite layer and MDM layer. The center wavelength of the planar detector can be tuned from 430 nm to 680 nm within the detection band of 400-800 nm, with a narrow FWHM about 30 nm and a relatively high response of 0.05 A/W @ 5 V bias voltage for 500 nm. Meanwhile the rise and fall times of the detector are 375 ms and 550 ms, respectively. The experimental results are corroborated by the theory. Our design is highly beneficial to such applications as hyperspectral photography and color-related active optical devices, which paves the way to design this kind of triple structure.