Over the past two decades, more than 160 million rural residents have migrated to cities in China. They are usually separated from their rural families and work in an unfamiliar, and sometimes hostile, city environment. This paper investigates to what extent city social networks alleviate mental health problems among these migrants. Using the longitudinal migrant survey from the Rural-to-Urban Migration in China (RUMiC) project, we find that larger social networks are significantly correlated with fewer mental health problems in both OLS and fixed effect estimates. To mitigate the endogeneity issue, we use past rainfall in the home county and the distance between home village and the closest transportation centre as the instrument variables for city social networks. The instrument variable estimates and fixed effect instrumental variable estimates suggest that an additional person in the city social networks of migrants reduces GHQ 12 by 0.12 to 0.16 Likert points. The results are robust for migrants who are less educated, who work long hours and who do not have access to social insurances in the city.