The James Webb Space Telescope is revolutionizing our understanding of exoplanetary systems by opening a new observational window onto giant, long-period planets. Its MIRI instrument uniquely provides medium-resolution spectroscopy in the mid-infrared, ideally suited to probing the atmospheres of cold, giant exoplanets. I will present MIRI spectroscopic observations of two directly imaged systems: the multiplanetary system HR 8799 and one of the coldest planetary-mass companions, GJ 504 b. By carefully subtracting the host star's diffraction pattern, we extracted spatially resolved spectra for each planet. The medium-resolution data enable detailed atmospheric characterization, revealing key molecules such as NH₃, a proxy for surface gravity and thus planetary mass, and CO₂, a tracer of atmospheric metallicity. These results highlight how MIRI is enabling direct atmospheric studies of widely separated giant planets, offering new insights into the formation and evolution of planetary systems.