The mathematical structure of nonlinear, isentropic longitudinal flows of an ideal magnetohydrodynamic plasma confined to a magnetic flux tube embedded in a quiescent nonmagnetic fluid is investigated. Exact analytical solutions are derived for a special type of nonlinear flow in the absence of gravity: the simple waves, for which all the unknowns depend on single functions of space and time. These exhibit analytically the formation of shock waves. Emphasis is placed on new features introduced by the magnetic distensibility, which acts as an additional restoring force, as compared with the hydrodynamic flow of gas along a rigid tube. Introducing a series expansion in a suitable parameter, it is shown that the hydrodynamic problem can be considered as the zeroth-order approach to the magnetic flux tube problem. Finally, the motion in a magnetic flux tube under the action of a piston advancing in a prescribed manner has been briefly considered. This problem is of current interest in relation to the generation of tube-guided waves in the solar atmosphere.