Fluids have played and still play a vital role in attaining an optimized output from industrial processes. However, due to technological advancement, fluids with high hydrothermal characteristics are required. In order to overcome these challenges, researchers have developed fluids with dispersed nanoparticles, which are recognized as nanofluids. Various types of nanoparticles can be added to base fluids to produce thermally enhanced liquids. Among these, the addition of multi-walled carbon nanotubes (MWCNTs) is considered the best due to the considerable enhancement of thermophysical properties and the stability of the solution. Thus, in the present investigation, an analysis of the heat transfer characteristics of an MWCNT–water nanofluid included in a star-shaped cavity equipped with a hot rectangular baffle is conducted. In addition, a uniform magnetic field is applied along the x-direction to oppose the convective flow generated by variations in density. Mathematical formulations under assumed boundary conditions and physical assumptions are established in the form of dimensionless PDEs. The finite-element-method-based software “COMSOL” is used to execute the numerical simulations. PARADISO is employed to resolve the developed non-linear system of equations. The effects of the governing parameters on the velocity and temperature fields are presented through streamlines and isotherms. The Nusselt number is evaluated to depict the impact of the addition of nanoparticles (MWCNTs) on the heat transfer enhancement. Changes in the horizontal and vertical components of velocity are also evaluated against the Rayleigh number and nanoparticle volume fraction via cutline representation.