Latent heat thermal energy storage (LHTES) offers significant energy-saving benefits, but its application is limited due to the low thermal conductivity of phase change material (PCM). To address this issue, this article studied the combined application of metal foam structures with different porosity gradients and multiple PCMs with different melting points through numerical simulation to accelerate the melting of PCM and enhance system efficiency. The results showed that the application of multiple PCMs improved the heat transfer performance of the system, reducing the complete melting time by 9.18% compared to using a single PCM with uniform metal foam. Based on the multi-PCM storage system with an average porosity of 0.90, this article designed metal foam structures with one-dimensional and two-dimensional porosity gradients and explored their impacts. The results indicated that in the structure with a one-dimensional porosity gradient along the heat flow direction, the positive gradient decreased thermal resistance, further reducing the complete melting time by 6.18%, while the negative gradient increased it by 19.78%. However, the temperature non-uniformity was lowest with the negative gradient and highest with the positive gradient. The optimal two-dimensional porosity gradient multi-PCM storage model not only reduced thermal resistance but also effectively solved the issue of uneven melting, reducing the complete melting time by 17.96% and increasing the energy storage efficiency by 20.16% compared to the single PCM system with uniform porosity. Furthermore, the article conducted a dimensionless analysis of the optimal structure and different gradient structures, establishing formulas for the liquid fraction concerning modified Fourier number, modified Stefan number, and modified Rayleigh number.