Ti3C2Tx (MXene) are attractive for electrode materials because of their high electrical conductivity, abundant interlayer ions and low density. However, the low energy density hinders its commercial application. Herein, a novel N-doped Ti3C2Tx MXene is synthesized by introducing a small organic molecule dicyandiamide (DCD) to tune the complex terminals. DCD can be inserted into the layers of Ti3C2Tx nanosheets while forming melamine by catalyst-free trimerization reaction. Then, melamine is converted into gt-C3N4 through high-temperature sintering. Finally, gt-C3N4 is oxidized to cyanuric acid (CA) through simple hydrothermal reaction. The prepared Ti3C2Tx/CA composite electrode exhibits up to 4.8 at.% nitrogen doping and has a stable triazine ring structure. It is also shown that the Ti3C2Tx/CA composite electrode has high specific capacitance and excellent cycling stability. More notably, it achieves an energy density of 51.1 Wh kg−1 at a power density of 2000 W kg−1, which exceeds the energy density of MXene based electrodes reported in the current literature. This excellent performance is attributed to the unique hydroxyl structure of the CA terminal and the excellent symmetry of CA in the composite electrode. In aqueous electrolytes, CA can form short chains during charging and the formation of short chains enables the storage of electrons and further provides a large number of new pseudocapacitive reaction sites for MXene. At the same time, the high electronegativity of the N and O atoms in CA also increases the electric double layer capacitor of the composite electrode to a certain extent, thus resulting in a high energy density of the composite electrode.