An optical fiber senor based on Mach-Zehnder interferometer (MZI) is proposed and experimentally demonstrated for the measurement of temperature and refractive index(RI) simultaneously. This structure is composed of a pair of spherical-shape structures and an embedded taper, where the spherical-shape structure excites high-order cladding modes and the taper enhances the penetration depth of evanescent field. Experimental results show that the interference peaks of the transmission spectrum have different sensitivity to temperature and RI, so that a matrix can be used to achieve the simultaneous measurement of the temperature and RI. Within the range of 10–100°C and 1.3432–1.4026RIU, temperature and RI resolution of ∼0.22°C and 1*10^-4RIU have been achieved by intensity-modulation. We also find the temperature resolution is 0.37°C by wavelength-modulation. The structure is compact, low cost, and applied to various fields to achieve simultaneous measurement of temperature and RI.