In this study MHD flow in a lid driven nanofluid filled square cavity with a flexible side wall is numerically investigated. The top wall of the cavity is colder than the bottom wall and it moves in the direction with constant speed. Other walls of the cavity are insulated. The finite element formulation is utilized to solve the governing equations. The Arbitrary-Lagrangian-Eulerian method is used to describe the fluid motion with the flexible wall of the cavity in the fluid–structure interaction model. The influence of the Young’s modulus of the flexible wall on the flow and heat transfer characteristics are numerically investigated for the following parameters: ( ), with a Richardson number of ( ), a Hartmann number of ( ) and a volume fraction of the solid particles given by ( ). The effect of Brownian motion on the effective thermal conductivity of the nanofluid is taken into account. Averaged heat transfer decreases with increasing Hartmann number and decreasing Richardson numbers. As the Young’s modulus of the flexible wall decreases, the averaged heat transfer increases and 66.5% of the heat transfer enhancement is obtained for compared with . An averaged heat transfer enhancement of 33.87% is obtained for a solid volume fraction of 4% compared to the base fluid for the fluid–structure model coupled with the magnetic field.