Lithium–sulfur (Li–S) batteries have been research hotspots because of their significant advantages in high-energy density and low cost. However, the notorious shuttle effect results in poor electrochemical performance, which is a serious obstacle for their practical application. The delicate design of sulfur hosts is a very important strategy to suppress the shuttle effect. Herein, MXene nanoflakes confined within multichannel carbon nanofibers (MXene@MCNF) have been successfully synthesized as robust electrocatalysts for Li–S batteries based on a simple electrospun method followed by a carbonization process. This unique structure effectively prevents the restacking of MXene nanoflakes, which is conducive to improve the electrocatalytic activity of MXene for propelling the redox reaction of polysulfides owing to the abundant exposure of surface active sites. Moreover, the multichannel hollow structure can inhibit the outward dissolution of polysulfides via the physical confinement caused by their abundant pore structures and alleviate the huge volume change of sulfur cathode. Benefiting from these aforementioned advantages, MXene@MCNF-sulfur (MXene@MCNF-S) cathode delivers a high capacity of 1177 mA h/g at 0.2 C and excellent cycling stability after 200 cycles at 2.0 C.