The adsorption, electronic, gas-sensing and capture properties of molecules (NO, H2S, SO2, NO2, NH3, N2, CO, CH4, CO2, and H2O) on the C6N7 monolayer were systematically studied to explore the possibilities of C6N7-based toxic gas sensor and scavenger by using first-principles methods. We found only NO, H2S, and SO2 are adsorbed on the monolayer with large adsorption energy (ranging of -0.853--0.931 eV), meanwhile the other molecules are all weakly physisorbed on the monolayer with Ead of -0.193--0.547 eV. The NO and H2S adsorption could remarkably affect the electronic properties and work function (& phi;) of the C6N7 monolayer, indicating it is highly sensitive and selective towards NO and H2S. The recovery time (& tau;) of NO and H2S was predicted respectively to be 25 and 1.9 s at 350 K, while the & tau; of the other molecules was too short to make the sensor device be difficult to measure these gases. The C6N7 monolayer can be promising resistance-type (& phi;-type) gas sensors for H2S and NO detection at 350 K. However, the presence of humidity effects the gas sensing of C6N7-based resistance-type sensor, so that it should operate in a dry environment, but as & phi;-type sensor can operate regardless of the exis-tence of humidity and concentrations. In addition, the high adsorption capacity and desired recovery time of the C6N7 monolayer make it be an optimal scavenger for toxic gases.