The Magnetic Resonance Imaging system（MRI）is an important diagnosis and treatment method of modern medicine. Benefiting from the advancement of superconducting magnet technology, the performance of MRI is continuously improved. In superconducting MRI, the main coils, as the most critical components, greatly determines the quality of images, further affecting the diagnosis. Therefore, the performance of main coils is the criterion for evaluating the quality of MRI. The Variable Density Method (VDM), one of the Topology Optimization methods originated from mechanics, has rich model description approaches, fast solving speed and wide applicability. Since the distribution design of the main coils is highly similar to the mechanical structure design by VDM, it is reasonable to combines the traditional design methods of the main coils with VDM to build a new optimization model. Eventually, the superconducting main coils, which can produce high homogeneity magnetic field, are obtained and its complex shape is further optimized to be easily processed and formed.