This article presents the development of a constrained optimization algorithm, whose scope is to support the preliminary design of a renewable microgrid, integrating solar panels and wind turbines with reversible solid oxide cells. The motivations behind this research activity lie in the increasing interest in renewable-based production and on-site storage of hydrogen, and its aim is to help this energy vector spread worldwide and in as many industrial and residential sectors as possible within a reasonably short timeframe. To this end, suitable models were developed by referring to the most relevant literature and by introducing some specific simplifying assumptions. Such an approach allowed the setting-up of a multi-variable constrained optimization task, whose outcomes correspond to the most techno-economic effective plant configuration with respect to assigned design criteria. The optimum solution was particularly sought via the generalized reduced gradient method, aimed at determining renewable plants sizes under the constraint that the final stored hydrogen level is brought back to the initial value after one year. The results highlight that an interesting payback time of about 10 years can be attained, while guaranteeing that the optimal configuration holds promising resiliency and islanded-use capabilities (such as almost weekly self-sufficiency) via smart over-the-year charge-sustaining management of the designed hydrogen storage tank. In this way, it was possible to simultaneously address, via the specific optimization problem formulation, the interconnected needs of optimally designing system components in terms of installed power, and the proper management of the reversible solid oxide cell unit.