We propose a locally smoothing method for some mathematical programs with complementarity constraints, which only incurs a local perturbation on these constraints. For the approximate problem obtained from the smoothing method, we show that the Mangasarian–Fromovitz constraints qualification holds under certain conditions. We also analyse the convergence behaviour of the smoothing method, and present some sufficient conditions such that an accumulation point of a sequence of stationary points for the approximate problems is a C-stationary point, an M-stationary point or a strongly stationary point. Numerical experiments are employed to test the performance of the algorithm developed. The results obtained demonstrate that our algorithm is much more promising than the similar ones in the literature.