To address the problems of easy leakage and high flammability of phase change materials, a series of innovative leakage-proof phase change composites (PCCs) with excellent solar thermal conversion capability and superior flame retardancy have been successfully developed. Herein, two-dimensional layered MXene nanosheets with excellent solar-thermal conversion effect were first synthesized by etching MAX phase with lithium fluoride and hydrochloric acid solutions. MXene/polyimide (PI) aerogel was then prepared by freeze-drying and thermal imidization after MXene dispersions mixed with poly (amic acid). The MXene/PI aerogels were subsequently impregnated into polyethylene glycol (PEG) by vacuum impregnation to obtain new shape-stable MXene/PI@PEG phase change composites (MPPCCs). Among them, MPPCC-4 exhibits a very high PEG loading capacity (98.1%) and high enthalpy (167.9 J/g), and a relative enthalpy efficiency of 99.8%. When compared to PEG, MPPCC-4 has outstanding flame retardant properties, including a 26.2% lower peak heat release rate and an 11.6% lower total heat release rate. In conclusion, MPPCCs show considerable potential for application in solar energy utilization systems.Graphical abstractMXene/polyimide hybrid aerogel supported phase change composites show excellent solar thermal energy harvesting and flame-retardant property.