Bio-based materials have attracted much attention because their application in the construction field is conducive to energy saving and emission reduction. In this paper, a bio-based composite phase change material (CPCM) was prepared by utilizing pitaya peel as a bio-based material, MXene quantum dots (MQDs) as a modified material, and polyethylene glycol (PEG) as a phase change medium. MXene quantum dots dispersed in the pitaya peel-based porous carbon skeleton enhanced the three-dimensional thermal conductivity network of the porous carbon skeleton somewhat improved the thermal conductivity (0.676 W/mK) of the polyethylene glycol/MXene quantum dots-modified pitaya peel-based porous carbon foam (PPF) composite phase change material (PEG/PPF@M). It is worth noting that PEG/PPF@M has excellent thermal stability and its enthalpy is basically unchanged after 100 cycles, which proves the recyclable stability of PEG/PPF@M in practical applications. PEG/PPF@M has great potential for thermal management of buildings and electronic components. Overall, a novel multifunctional CPCM was prepared in this study using a simple process method, which can not only be applied in electronic products to improve the service life of electronic components, but also in the field of construction to realize energy saving and emission reduction, as well as the recycling and reuse of waste.