We report an ytterbium (Yb) doped fiber Mach Zehnder interferometer (MZI) based on the up-taper fiber structure in a fiber ring laser (FRL) cavity. Different from the traditional FRL sensing system, in which additional filters are required, the designed structure simultaneously acts as a filter, sensor and gain medium. Furthermore, thanks to the high thermal–optical coefficient of Yb doped fiber, the temperature sensitivity of 0.261 nm/°C can be achieved in the range of 10–50 °C. In addition, benefiting from the unique characteristics of the laser system itself, the designed structure has a narrower linewidth (−0.2 nm) and a higher signal-to-noise ratio (SNR) (−40 dB) than the sensor system based on a broadband light source (BBS). Meanwhile, the refractive index (RI) response and stability of the system are measured. The RI sensitivity is up to 151 nm/RIU, and the wavelength fluctuation range within two hours is less than 0.2 nm. Therefore, the designed structure is expected to play a significant role in human life safety monitoring, aircraft engine temperature monitoring, etc.