The current investigation constitutes a numerical exploration of an innovative strategy centered on a 3D photovoltaic thermal (PVT) system merged with a phase change material (PCM) and metal foam. In this novel arrangement, a metal foam exhibiting varying degrees of porosity (PVT/PCM + copper foam) is introduced within the PCM compartment. The primary objective of this research is to assess the impact of particular parameters on the thermal and electrical efficacy of the PVT/PCM + copper foam system, which employs nanofluid as its operational fluid. This assessment is carried out using a parametric analysis approach. The parameters considered for examination encompass the mass flow rate, nanofluid mass fraction, and porosity of the metal foam. Additionally, an exhaustive analysis of temperature distribution and PCM melting phenomena within the studied system is conducted, relying on the obtained contours. The outcomes of the study unveiled that with an increase in the porosity of the metal foam from 0.2 to 0.8, the thermal efficiency of the system encounters a notable improvement of 33 %, while the electrical efficiency witnesses a minor reduction of 2.6 %. Furthermore, a comparison between the PVT/PCM and the PVT/PCM + copper foam configuration demonstrates that incorporating copper foam into the PCM setup results in a substantial 25.4 % enhancement in thermal efficiency and a 3.9 % increase in electrical efficiency.