The adsorptions of gas (CO, CO2, NH3) by metal (Au, Ag, Cu)-doped single layer WS2 are studied by density functional theory. The doping of metal atoms makes WS2 behave as n-type semiconductors. The final adsorption sites for CO, CO2, and NH3 are close to the atomic sites of the doped metal. The adsorptions of CO and NH3 gases on Cu/WS2, Ag/WS2, and Au/WS2 are dominated by chemisorption. The doped metal atoms enhance the hybridization of the substrate with the gas molecular orbitals, which contributes to the charge transfer and enhances the adsorption of the gas with the material surface. The adsorptions of CO and NH3 on Cu/WS2 and Ag/WS2 allow favorable desorption in a short time after heating. The single-layer Cu/WS2 is proved to have the potential to be used as a reliable recyclable sensor for CO. This work provides a theoretical basis for developing high-performance WS2-based gas sensors. In this paper, the adsorption energy, electronic structure, charge transfer, and recovery time of CO, CO2, and NH3 in the doped system have been investigated based on the CASTEP code of density functional theory. The exchange correlation function used is the Perdew-Burke-Ernzerhof (PBE) generalized gradient approximation (GGA). The TS (Tkatchenko-Scheffler) dispersion correction method was used to involve the effects of van der Waals interaction on the adsorption energies for all adsorption system. The ultrasoft pseudopotentials are chosen and the plane-wave cut-off energies are set to 500eV. The k-point mesh generated by the Monkhorst package scheme is used to perform the numerical integration of the Brillouin zone and 5 × 5 × 1k-point grid is used. The tolerances of total energy convergence, maximum ionic force, ionic displacement, and stress component are 1.0 × 10-5eV/atom, 0.03eV/Å, 0.001Å, and 0.05 GPa, respectively.