  The Medium-Resolution integral field Spectrometer (MRS) of MIRI on board JWST
performs spectroscopy between 5 and 28~$\mu$m. The optics of the MRS introduce
substantial distortion, and this needs to be rectified in order to reconstruct
the observed astrophysical scene. We use data from the JWST/MIRI commissioning
and cycle 1 calibration phase, to derive the MRS geometric distortion and
astrometric solution, a critical step in the calibration of MRS data. These
solutions come in the form of transform matrices that map the detector pixels
to spatial coordinates of a local MRS coordinate system called
$\alpha$/$\beta$, to the global JWST observatory coordinates V2/V3. For every
MRS spectral band and each slice dispersed on the detector, the transform of
detector pixels to $\alpha$/$\beta$ is fit by a two-dimensional polynomial,
using a raster of point source observations. A polynomial transform is used to
map the coordinates from $\alpha$/$\beta$ to V2/V3. We calibrated the
distortion of all 198 discrete slices of the MIRI/MRS IFUs, and derived an
updated Field of View (FoV) for each MRS spectral band. The precision of the
distortion solution is estimated to be better than one tenth of a spatial
resolution element, with a root mean square (rms) of 10 milli-arcsecond (mas)
at 5 $\mu$m, to 23 mas at 27 $\mu$m. Finally we find that the wheel positioning
repeatability causes an additional astrometric error of rms 30 mas. We have
demonstrated the MRS astrometric calibration strategy and analysis enabling the
calibration of MRS spectra, a critical step in the data pipeline especially for
science with spatially resolved objects. The distortion calibration was folded
into the JWST pipeline in Calibration Reference Data System (CRDS) context
jwst\_1094.pmap. The distortion calibration precision meets the pre-launch
requirement, and the estimated total astrometric uncertainty is 50 mas.
