Nowadays, the need for hybrid Shipboard Microgrid (SMG) optimization, integration, and control is rising constantly. This paper provides an optimal hierarchical control scheme for integrating microgrid systems comprising AC and DC electrical distribution networks fora shipboard architecture. Utilizing this power by the inverter can result in rapid spikes in the AC/DC voltages, potentially reducing the overall performance of the hybrid microgrid. The proposed Model Predictive Control (MPC) based controller shows better performances in the reduction of transient droops of the AC/DC voltages and handling parametric changes, load variations, and grid transitions. We provided the analytical solution for implementing proposed optimal design of hierarchical control for a multi-DG and renewable energy resources (RESs) integration-based shipboard microgrid. The performance of pproportional integral (PI), Sliding Mode Controller (SMC), and MPC based optimal hierarchical control designs are compared through simulation test cases with various static and dynamic load conditions, both for AC and DC-type loads. Furthermore, we extended our analysis to include multiple distribution generator (DG) and RES involvements in the system to demonstrate the enhanced performance of our design against parametric variations and undesirable faulty load conditions. Additionally, the architecture incorporates multiple DG and RES to enhance system scalability and flexibility. Simulation results validated in MATLAB/Simulink show improved energy optimization and resilience across various static and dynamic load conditions. Practical hardware implementation using the NVIDIA Jetson Nano further confirms the real-time applicability of the control strategies.