The stochastic approach to the determination of the largest Lyapunov exponent of a many-particle system is tested in the so-called mean-field XY Hamiltonians. In weakly chaotic regimes, the stochastic approach relates the Lyapunov exponent to a few statistical properties of the Hessian matrix of the interaction, which can be calculated as suitable thermal averages. We have verified that there is a satisfactory quantitative agreement between theory and simulations in the disordered phases of the XY models, either with attractive or repulsive interactions. Part of the success of the theory is due to the possibility of predicting the shape of the required correlation functions, because this permits the calculation of correlation times as thermal averages.