Transition metal dichalcogenides (TMDCs) have been proposed as light absorber materials for ultrathin solar cells. These materials are characterized by their strong light-matter interaction and the possibility to be assembled into devices at room temperature. Here, we model the optical absorptance of an ultrathin MoS2 absorber embedded in different designs of a 1D optical cavity. We find that up to 87% of the photons contained in the 300-700 nm range of the AM1.5G spectrum can be absorbed employing MoS2 absorbers as thin as 10 nm sandwiched between a h-BN top layer and an optically thick Ag reflector. An h-BN/MoS2/h-BN/Ag cavity produces 0.89 average absorptance for a 57-nm-thick MoS2 slab and it also maximizes the absorption of extremely thin absorbers, between 1 and 9 nm. We also model a possible large-scale device on a glass substrate combined with indium-tin oxide (ITO) whose absorptance is comparable to the other presented structures. The high broadband absorption in these light-trapping structures is caused by the amplification of the zeroth Fabry-Perot interference mode. This study demonstrates that light absorption in ultrathin solar cells based on nanometric TMDC absorbers can compete with conventional photovoltaic technology and provides different simple optical designs to choose from depending on the electronic characteristics of the TMDC junction.