We propose a method for the evaluation of magnetic exchange couplings based on noncollinear spin density functional calculations. The method employs the second derivative of the total Kohn-Sham energy of a single reference state, in contrast to approximations based on Kohn-Sham total energy differences. The advantage of our approach is twofold: It provides a physically motivated picture of the transition from a low-spin to a high-spin state, and it utilizes a perturbation scheme for the evaluation of magnetic exchange couplings. The latter simplifies the way these parameters are predicted using first principles: It avoids the nontrivial search for different spin states that needs to be carried out in energy difference methods, and it opens the possibility of "black-boxifying" the extraction of exchange couplings from density functional theory calculations. We present proof of concept calculations of magnetic exchange couplings in the H-He-H model system and in an oxovanadium bimetallic complex where the results can be intuitively rationalized.