The possibility to improve the detection index of the optical ammonia gas sensors on the basis of the graphene/polyaniline (graphene/PANI) coated Mach–Zehnder interferometric optical fiber structure with etched thinned core fiber(e-TCF) is investigated. Based on the analysis of the output wavelength, a significant increase in sensitivity and stability of the ammonia sensors is achieved by using TCF. Experimental results show that its sensitivity is -27.8 pm/ppm, the response time is 32 s, dip wavelength error is lower than ±0.02 nm, and the dip intensity error is lower than ±0.002 dB in the stability test. This research illustrates that the proposed sensor has numerous advantages, including small size, strong anti-electromagnetic interference, and excellent repeatability characteristics. Furthermore, it can be applied in biomedical detection applications as it can improve the detection resolution of ammonia concentration at room temperature.