The recently developed hard-magnetic soft (HMS) materials can play a significant role in the actuation and control of medical devices, soft robots, flexible electronics, etc. To regulate the mechanical behaviors of the cantilevered pipe conveying fluid, the present work introduces a segment made of the HMS material located somewhere along the pipe length. Based on the absolute node coordinate formulation (ANCF), the governing equations of the pipe conveying fluid with an HMS segment are derived by the generalized Lagrange equation. By solving the derived equations with numerical methods, the static deformation, linear vibration characteristic, and nonlinear dynamic response of the pipe are analyzed. The result of the static deformation of the pipe shows that when the HMS segment is located in the middle of the pipe, the downstream portion of the pipe centerline will keep a straight shape, providing that the pipe is stable with a relatively low flow velocity. Therefore, it is possible to precisely regulate the ejection direction of the fluid flow by changing the magnetic and fluid parameters. It is also found that the intensity and direction of the external magnetic field greatly affect the stability and dynamic response of the pipe with an HMS segment. In most cases, the magnetic actuation increases the critical flow velocity for the flutter instability of the pipe system and suppresses the vibration amplitude of the pipe.