This paper focuses on indefinite stochastic mean-field linear–quadratic (MF-LQ, for short) optimal control problems, which allow the weighting matrices for state and control in the cost functional to be indefinite. The solvability of stochastic Hamiltonian system and Riccati equations is presented under indefinite case. The optimal controls in open-loop form and closed-loop form are derived, respectively. In particular, dynamic mean–variance portfolio selection problem can be formulated as an indefinite MF-LQ problem to tackle directly. Another example also sheds light on the theoretical results established.