We proposed a refractive index (RI) sensing method with temperature compensation by using an optical frequency comb (OFC) sensing cavity including a multimode-interference (MMI) fiber, namely, the MMI-OFC sensing cavity. The MMI-OFC sensing cavity enables simultaneous measurement of material-dependent RI and sample temperature by decoding from the comb spacing frequency shift and the wavelength shift of the OFC. We realized the simultaneous and continuous measurement of RI-related concentration of a liquid sample and its temperature with precisions of 1.6 × 10-4 RIU and 0.08 °C. The proposed method would be a useful means for the various applications based on RI sensing.