Inorganic CsPbI3 perovskite solar cells have received increasing attention for their excellent stability and high photovoltaic conversion efficiency. However, the transport layers used in such solar cells are usually organic materials which might lead to unstable performance. The optimized inorganic transport layer materials are selected using the numerical simulation program SCAPS-1D in this work. Then a molybdenum disulfide (MoS2) layer is inserted between the hole transport layer and the perovskite layer to build the complete inorganic ITO/CuI/MoS2/CsPbI3/SnO2/Al cell structure. The effect of parameter variations on the MoS2 layer, the absorber layer, and the interface defects on the cell performance is investigated. The results show that the insertion of the MoS2 layer of 6 nm thickness is more tolerant to the defect density and effectively increases the power conversion efficiency by 12%. Finally, the optimized conversion efficiency reaches 21.74%, which is close to the efficiency of current mainstream solar cells. This work provides an idea for the future development of the all-inorganic perovskite solar cells (PSCs) combined with the MoS2 materials.