Helium mass spectrometry leak detection technology requires that the leak detection medium of spacecraft test object is helium, but the general working medium of spacecraft electric propulsion system is xenon. The existing helium mass spectrometry leak detection technology can not realize the in-situ leak detection of all kinds of working media. The in situ mass spectrometry leak detection technology of spacecraft working medium based on mass spectrometry has been widely concerned for its advantages of direct leak detection of working medium and obtaining real leak rate, but the sampling and leak detection of mass spectrometry under atmospheric environment is one of its difficulties. In this paper, a leak detection model and test system of spacecraft working medium in situ mass spectrometry are established, and theoretical and experimental studies are carried out. The research results show that, The leak detection sensitivity of in situ working mass spectrometry is better than 1.0 × 10−8 Pa m3/s by shunt current limiting sampling method in atmospheric environment. The appropriate shunt pumping speed and shunt chamber pressure have important influence on in situ leak detection of working medium. When the pressure of capillary shunt chamber is higher than 550Pa, the test system has better stability and repeatability. Not only the background noise of the leak detection by mass spectrometry is reduced, the detection accuracy is improved, and the response time of the system is shortened.