Manipulating the electronic environment of the reactive center to lower the energy barrier of the rate-determining water oxidation step for boosting the direct generation of H2O2 from water, air, and sunlight is fascinating yet remains a grand challenge. Driven by a first-principles screening across a series of metal single atoms in carbon nitride, we report a class of an Al-N3 bridge site enabling interlayer charge transfer in carbon nitride nanotubes (CNNT-Al) for the highly efficient photosynthesis of H2O2 directly from water, oxygen, and sunlight. We demonstrate that the interlayered Al-N3 bridge site in CNNT-Al is able to activate the neighboring surface N atom for promoting the rate-determining step of the two-electron water oxidation to H2O2. It is also able to act as a bridge for enhancing the vertical interlaminar charge transfer due to the hybridization between the 3s and 3p states of the interstitial Al atom and the conduction band of two adjacent carbon nitride layers. Collectively, these factors lead to a highest photocatalytic mass activity of 1410.2 μmol g-1 h-1 (with a photocatalyst concentration of 1 g L-1) for direct photosynthesis of H2O2 out of all CN-based photocatalysts and a 7-fold higher solar-to-chemical conversion efficiency (0.73%) compared to that of the natural photosynthesis of typical plants (∼0.1%). Most importantly, the CNNT-Al-based flow reactor can steadily produce H2O2 for 200 h and be directly used for the on-site degradation of organic dye in water. The CNNT-Al-based flow reactor can also kill a 10 times higher concentration of bacteria in deionized water than that in natural water with 100% efficiency, which makes our design economically appealing for practical water treatment.