  Extremely red quasars, with bolometric luminosities exceeding $10^{47}$ erg
s$^{-1}$, are a fascinating high-redshift population that is absent in the
local universe. They are the best candidates for supermassive black holes
accreting at rates at or above the Eddington limit, and they are associated
with the most rapid and powerful outflows of ionized gas known to date. They
are also hosted by massive galaxies. Here we present the first integral field
unit (IFU) observations of a high-redshift quasar obtained by the Near Infrared
Spectrograph (NIRSpec) on board the James Webb Space Telescope (JWST), which
targeted SDSSJ165202.64+172852.3, an extremely red quasar at $z=2.94$. JWST
observations reveal extended ionized gas - as traced by [OIII]$\lambda$5007\AA
- in the host galaxy of the quasar, its outflow, and the circumgalactic medium.
The complex morphology and kinematics imply that the quasar resides in a very
dense environment with several interacting companion galaxies within projected
distances of 10-15 kpc. The high density of the environment and the large
velocities of the companion galaxies suggest that this system may represent the
core of a forming cluster of galaxies. The system is a good candidate for a
merger of two or more dark matter halos, each with a mass of a few $10^{13}$
M$_\odot$ and traces potentially one of the densest knots at $z\sim3$.
