This paper presents an energy management framework for a grid-connected microgrid consisting of photovoltaic (PV) panels, wind turbines, battery storage, and electric vehicles (EVs). EVs are modeled as mobile storage units with stochastic driving and charging behavior. A model predictive control (MPC) approach is implemented to minimize the total operational cost, which considers electricity purchase from the grid, battery degradation, and EV state-of-charge (SOC) constraints. Renewable generation, load demand, and EV trip profiles are modeled with stochastic variations to capture uncertainties. Simulation results over a 24-hour horizon demonstrate that the proposed MPC-based strategy efficiently balances supply and demand, reduces energy cost, and maintains reliable SOC levels for EVs, while enabling both energy import and export with the main grid.