In recent years, the ecological and environmental problems caused by mining in the Qilian Mountains have attracted considerable attention, and the government has carried out a number of comprehensive ecological environment remediation projects there, among which ecological restoration in the Qilian Mountain alpine mining area is an essential task. As a result, heavy metals have been studied in the soil of the Qilian Mountain alpine mining area. This can provide a scientific basis and data support for the establishment of a demonstration index for monitoring ecological environmental restoration in mining areas. In order to understand the content and contamination status of heavy metals in the soil surrounding the alpine mining area of Qilian Mountain, 56 soil samples were collected to determine the levels of eight heavy metals, including Cd, Hg, As, Pb, Cr, Cu, Zn, and Ni. The spatial distribution of heavy metals in the soil of the study area was analyzed based on a statistical approach. The single-factor pollution index (Pi), Nemerow comprehensive pollution index (PN), geoaccumulation index (Igeo), and potential ecological risk index (RI) were used to evaluate soil heavy metal pollution and potential ecological risk. Principal component analysis (PCA), positive matrix factorization (PMF) models, and geostatistical analysis were also used to investigate the source of heavy metals. The results show that the average Cd, As, Cr, Cu, Zn, and Ni content of the grassland soil around the mining area exceeds the soil background values in both Qinghai Lake Basin and Qinghai Province. The spatial distribution of the eight heavy metal elements in soil showed an island-like pattern, with high-value areas of each metal element appearing, indicating that human activities in the study area had negative effects on the soil environment. The value of the single pollution index showed that levels of Ni, Cd, Cu, Cr, Hg, and As pollution were low, while there was no Pb or Zn pollution. The Nemerow integrated pollution index had an average value of 1.39, indicating a slight pollution trend. The average values of Cr and Zn in the geoaccumulation index ranged from 0 to 1, indicating mild to moderate contamination in the studied region. The average value of the integrated ecological risk index in the study area was 135.43, which is in the intermediate ecological risk range. In descending order of size, the average ecological risk index of each heavy metal element was Hg > Cd> As > Ni > Cu > Pb > Cr > Zn. From the perspective of the spatial distribution pattern of ecological risk, the two high-value discriminants were in the western part of the study area, close to the mining area. Zn, Cu, Pb, and Cd in soils were mainly affected by human activity, while Cr and Ni were mainly affected by soil geochemistry. Cd is the main contaminant in the study area, and soil Cd contamination of the grassland in the study area must be considered.