The effectiveness of photovoltaic energy systems is contingent upon climatic variables, particularly sun irradiance and temperature. These considerations have prompted significant advancements in the development of novel Maximum Power Point Tracking (MPPT) techniques. The presence of partial shadowing condition gives rise to significant challenges, including a reduction in the output power generation and the emergence of several peaks in the PV characteristic; Also, it effects on the power quality injected to the grid. Therefore, the optimization of the global maximum power point (GMPP) under partial shading conditions is a challenging issue. In order to address this issue. This work provides a comparison of MPPT procedures utilizing the Grey Wolf optimization (GWO) method and the Cuckoo Search (CS) method. Furthermore, it explores the impact of these MPPT algorithms on the total harmonic distortion (THD) when implemented under identical system characteristics and climatic conditions. Using MATLAB simulation, the results demonstrate that before injecting power from PV, the MPC achieves a good THD Valeu of 1.87%, and that after injecting power, GWO outperforms CS in response time and efficiency, and has a lower THD value of 4.68%.