Context. We self-consistently model a magnetically supported accretion disk around a stellar-mass black hole with a warm optically thick corona based on first principles. We consider the gas heating by magneto-rotational instability dynamo. Aims. Our goal is to show that the proper calculation of the gas heating by magnetic dynamo can build up the warm optically thick corona above the accretion disk around a black hole of stellar mass. Methods. Using the vertical model of the disk supported and heated by the magnetic field together with radiative transfer in hydrostatic and radiative equilibrium, we developed a relaxation numerical scheme that allowed us to compute the transition form the disk to corona in a self-consistent way. Results. We demonstrate here that the warm (up to 5 keV) optically thick (up to 10 τes) Compton-cooled corona can form as a result of magnetic heating. A warm corona like this is stronger in the case of the higher accretion rate and the greater magnetic field strength. The radial extent of the warm corona is limited by local thermal instability, which purely depends on radiative processes. The obtained coronal parameters are in agreement with those constrained from X-ray observations. Conclusions. A warm magnetically supported corona tends to appear in the inner disk regions. It may be responsible for soft X-ray excess seen in accreting sources. For lower accretion rates and weaker magnetic field parameters, thermal instability prevents a warm corona, giving rise to eventual clumpiness or ionized outflow.