Green hydrogen supply chain optimization requires integrated forecasting frameworks linking meteorological prediction with photovoltaic electrolyzer system performance for strategic site selection and infrastructure planning. This study develops an end-to-end XGBoost MATLAB framework to forecast and optimize solar hydrogen production across Morocco’s Atlantic coastal corridor. Extreme Gradient Boosting models trained on NASA POWER satellite data were used to predict ambient temperature and global horizontal irradiance at four coastal sites. Forecasted meteorological variables were coupled with deterministic photovoltaic and proton exchange membrane (PEM) electrolyzer simulations implemented in MATLAB. The forecasting models achieved high predictive accuracy (R2 > 0.99 for temperature and R2 > 0.95 for irradiance), while hydrogen production estimates maintained errors below 8% during multi-year validation. Comparative analysis identified Dakhla as the optimal site, delivering the highest annual hydrogen yield due to superior solar resource and capacity factor. The proposed framework provides a reproducible technical decision support tool for renewable hydrogen site selection and infrastructure planning.