A novel design of a continuous toroidal solenoid for the small spherical tokamak MEPhIST-0 is presented. The solenoid’s geometry is optimized in regard to stray magnetic fields perpendicular to the toroidal fields based on Maxwell’s equations and interface conditions for magnetic fields. The solutions obtained may in theory provide the level of stray fields ~10−10 of the toroidal fields. The design of the solenoid is tested by means of COMSOL modeling. The observed ratio of stray fields to the toroidal component of magnetic fields, Bp/BT is approximately ~0.4% at the plasma center. A ripple of the toroidal magnetic field at the edge of the plasma of δ ~ 0.8% is observed. The possibility of plasma breakdown with the chosen toroidal solenoid configuration was evaluated using the DINA calculation code.