Context. Characterization of directly imaged exoplanets is one of the most eagerly anticipated science functions of the James Webb Space Telescope. MIRI, the mid-IR instrument, has the capability to provide unique spatially resolved photometric data points in a spectral range never before achieved for such objects. Aims. We aim to present the very first on-sky contrast measurements of the MIRI coronagraphs. In addition to a classical Lyot coronagraph at the longest wavelength, this observing mode implements the concept of the four-quadrant phase mask for the very first time in a space telescope. Methods. We observed single stars together with a series of reference stars to measure raw contrasts as they are delivered on the detector, as well as reference-subtracted contrasts. Results. The MIRI coronagraphs achieve raw contrasts better than 10 −3 at the smallest angular separations (within 1″) and about 10 −5 farther out (beyond 5 ~ 6″). Subtracting the residual diffracted light left behind the coronagraph has the potential to bring the final contrast down to the background- and detector-limited noise floor at most angular separations (a few times 10 −5 at less than 1″). Conclusions. The MIRI coronagraphs behave as expected from simulations. In particular, the raw contrasts for all four coronagraphs are fully consistent with the diffractive model. Contrasts obtained by subtracting reference stars also meet expectations and are fully demonstrated for two four-quadrant phase masks (F1065C and F1140C). The worst contrast, measured at F1550C, is very likely due to a variation in the phase aberrations at the primary mirror during the observations, and not an issue with the coronagraph itself. We did not perform reference star subtraction with the Lyot mask at F2300C, but we anticipate that it would bring the contrast down to the noise floor.