Carbon nanotubes (CNTs) are of great interest for many potential applications because of their extraordinary electronic, mechanical and structural properties. However, issues of chaotic staking, high cost and high energy dissipation in the synthesis of CNTs remain to be resolved. Here we develop a facile, general and high-yield strategy for the oriented formation of CNTs from metal-organic frameworks (MOFs) through a low-temperature (as low as 430 °C) pyrolysis process. The selected MOF crystals act as a single precursor for both nanocatalysts and carbon sources. The key to the formation of CNTs is obtaining small nanocatalysts with high activity during the pyrolysis process. This method is successfully extended to obtain various oriented CNT-assembled architectures by modulating the corresponding MOFs, which further homogeneously incorporate heteroatoms into the CNTs. Specifically, nitrogen-doped CNT-assembled hollow structures exhibit excellent performances in both energy conversion and storage. On the basis of experimental analyses and density functional theory simulations, these superior performances are attributed to synergistic effects between ideal components and multilevel structures. Additionally, the appropriate graphitic N doping and the confined metal nanoparticles in CNTs both increase the densities of states near the Fermi level and reduce the work function, hence efficiently enhancing its oxygen reduction activity. The viable synthetic strategy and proposed mechanism will stimulate the rapid development of CNTs in frontier fields.