An efficient and stable catalyst is the key to electrocatalytic hydrogen production. Herein, a bifunctional electrocatalyst is developed for electrocatalytic hydrogen production by depositing S -doped g-C 3 N 4 on Co/Ni metalorganic framework electrode (namely CoNi-MOFs/S-g-C 3 N 4 ). Compared with the original Co/Ni metal -organic framework (CoNi-MOFs), the overpotential of hydrogen production on CoNi-MOFs/S-g-C 3 N 4 is reduced by 49.5 %, the charge transfer resistance is reduced by 74.5 %, and the electrochemically active area is expanded by 60.1 times. Moreover, CoNi-MOFs/S-g-C 3 N 4 can be used as an efficient bifunctional electrocatalyst for overall water splitting. Impressively, using CoNi-MOFs/S-g-C 3 N 4 as the anode and cathode, the hydrogen yield can reach 5.513 mmol h -1 and the energy consumption is 5.822 kWh Nm - 3 at a current density of 250 mA cm -2 . In addition, an in -situ overall water splitting system was designed for hydrogen production using high -salt wastewater as water source without additional pre -desalination process, which realizes green hydrogen production and reduces the cost. The hydrogen yield was hold in the range of 5.2 -5.3 mmol h -1 for a week, showing excellent performance of hydrogen production and strong stability. More importantly, the system can be applied to various high -salt wastewater with wider pH and salinity, and shows promising application potential for hydrogen production in actual wastewater.