The implementation of muscle ergometry during magnetic resonance spectroscopy and imaging is complicated by the restrictive dimensions of the magnet bore and the presence of a strong static magnetic field. We have developed a dynamometer that is compatible with these constraints. This device can provide resistance to voluntary muscle contraction during isometric, isokinetic concentric, and isokinetic eccentric muscle contractions. While controlling muscle contraction speed, the dynamometer simultaneously records muscle torque production at a 10-Hz sampling frequency to allow assessment of compliance and retrospective normalization of power output for the mass of active muscle. All parameters relevant to muscle contraction are selectable, including percentage of maximal voluntary contraction, velocity of muscle contraction, duty cycle, and range of motion for the contraction. This paper provides examples of 31P-magnetic resonance spectroscopic measurements during isokinetic concentric contractions of the ankle dorsiflexors, isokinetic eccentric contractions of the soleus, and isometric contractions of the soleus. Operation of the dynamometer has no adverse effects on the integrity of the 31P-magnetic resonance spectra at 4 T, permitting temporal resolution of the phosphocreatine resynthesis rate of approximately 1 spectrum/s. The unique capabilities of this dynamometer will facilitate studies into the metabolic response of working muscle in healthy and diseased populations.