Amorphous carbon materials with sophisticated morphologies, variable carbon layer structures, abundant defects, and tunable porosities are favorable as anodes for potassium-ion batteries (PIBs). Synthesizing amorphous carbon materials typically involves the pyrolysis of carbonaceous precursors. Nonetheless, there is still a lack of studies focused on achieving multifaceted structural optimizations of amorphous carbon through precursor formulation. Herein, nitrogen-doped amorphous carbon nanotubes (NACNTs) are derived from a novel composite precursor of cobalt-based metal–organic framework (CMOF) and graphitic carbon nitride (g-CN). The addition of g-CN in the precursor optimizes the structure of amorphous carbon such as morphology, interlayer spacing, nitrogen doping, and porosity. As a result, NACNTs demonstrate significantly improved electrochemical performance. The specific capacities of NACNTs after cycling at current densities of 100 mA/g and 1000 mA/g increased by 194 % and 230 %, reaching 346.6 mAh/g and 211.8 mAh/g, respectively. Furthermore, the NACNTs anode is matched with an organic cathode for full-cell evaluation. The full-cell attains a high specific capacity of 106 mAh/gcathode at a current density of 100 mA/g, retaining 90.5 % of the specific capacity of the cathode half-cell. This study provides a valuable reference for multifaceted structural optimization of amorphous carbon to improve potassium-ion storage capability.