• A size-dependent CNT model is developed based on a partially distributed tangential force and viscoelastic foundation. • The foundation is assumed in three different types, including Kelvin, Maxwell and Standard linear solid models. • The applied force induced by magnetic-fluid flow is considered according to Navier–Stokes equation. • Effects of several parameters on the frequencies and flutter instabilities are studied. Dynamic instability of cantilever carbon nanotubes conveying fluid embedded in viscoelastic foundation under a partially distributed tangential force is investigated based on nonlocal elasticity theory and Euler–Bernouli beam theory. The present study has incorporated the effects of nonlocal parameter, Knudsen number, surface effects and magnetic field. And two main parameters have also considered, namely partially distributed tangential force and foundation. It is assumed that viscoelastic foundation has modeled as Kelvin–Voigt, Maxwell and Standard linear solid types. The size-dependent governing equation of transverse vibration is derived using Hamilton’s variational principle and discretized by the Galerkin truncation method. A detailed parameter study is carried out, indicating the stability behavior of the nanotubes. In the light of numerical results, it is shown that variables considered in nondimensional equations have significant effects on natural frequencies and flutter velocities, especially for the foundation distribution length and model as well as the partially distributed tangential force.