Autonomous rendezvous and docking, whereby two spacecraft come into close proximity and subsequently make mechanical contact, is used for on-orbit servicing missions. The safety of these missions is endangered by space debris and other hazards that pose a threat for collisions. The guidance algorithm onboard a spacecraft is responsible for planning a safe path to a target spacecraft and must actively avoid these hazards for the mission's success. This thesis presents a real-time optimal guidance algorithm for autonomous path-planning with moving obstacles based upon the Model Predictive Control framework. Numerical simulations are completed in two- and three-dimensions to prove the functionality of the algorithm. The current laboratory facility was upgraded to validate the real-time collision avoidance capabilities of the algorithm. The experiments are, to the best of the author's knowledge, the first to demonstrate the moving obstacle avoidance capabilities of a Model Predictive Controller for spacecraft rendezvous and docking.