Although metallic lithium is regarded as the most potential anode candidate for next-generation batteries, its applications are greatly restricted by the uncontrollable growth of lithium dendrites and unstable anode/electrolyte interface. Herein, MXene/MOFs heterojunction nanosheets are developed through a convenient self-assembly process by harnessing the chemical interactions between MXene and Ni-MOFs monolayers. In this heterojunction, not only the MXene interlayer induces uniform lithium nucleation, but also MOFs monolayers act as stable interfaces to promote Li ion transport and homogenize the subsequent lithium deposition. Moreover, the MXene/MOFs substrate mitigates the volume change of lithium anodes. Consequently, 2D MXene/MOFs heterojunction nanosheets as confinement hosts effectively suppress lithium dendrites and exhibit enhanced electrochemical performances including a coulombic efficiency of 99 % over 300 cycles at 0.5 mA cm−2 and 1 mAh cm−2, and a long cycling life up to 500 h at 1 mA cm−2 and 1 mAh cm−2. The MXene/MOFs-Li||LiFePO4 cells exhibit a stable cycling performance with a capacity retention of 91 % after 600 cycles.