This paper presents a monolithic formulation framework combined with an anisotropic mesh adaptation for fluid–structure interaction (FSI) applications with complex geometry. The fluid–solid interfaces are captured using a level-set method. A new a posteriori error estimate, based on the length distribution tensor approach and the associated edge based error analysis, is then used to ensure an accurate capturing of the discontinuities at the fluid–solid interface. It enables to calculate a stretching factor providing a new edge length distribution, its associated tensor and the corresponding metric. The optimal stretching factor field is obtained by solving an optimization problem under the constraint of a fixed number of edges in the mesh. The presence of the structure will be taken into account by means of an extra stress tensor in the Navier–Stokes equations. The system is solved using a stabilized three-field, stress, velocity and pressure finite element (FE) formulation. It consists in the decomposition for both the velocity and the pressure fields into coarse/resolved scales and fine/unresolved scales and also in the efficient enrichment of the extra constraint. We assess the accuracy of the proposed formulation by simulating 2D and 3D time-dependent numerical examples such as: falling disk in a channel, turbulent flows behind an airfoil profile and flow behind an immersed vehicle.