  The Mid-Infrared Instrument (MIRI) Medium Resolution Spectrometer (MRS) is
the only mid-IR Integral Field Spectrometer on board James Webb Space
Telescope. The complexity of the MRS requires a very specialized pipeline, with
some specific steps not present in other pipelines of JWST instruments, such as
fringe corrections and wavelength offsets, with different algorithms for point
source or extended source data. The MRS pipeline has also two different
variants: the baseline pipeline, optimized for most foreseen science cases, and
the optimal pipeline, where extra steps will be needed for specific science
cases. This paper provides a comprehensive description of the MRS Calibration
Pipeline from uncalibrated slope images to final scientific products, with
brief descriptions of its algorithms, input and output data, and the accessory
data and calibration data products necessary to run the pipeline.
