Agri-food system is facing multiple challenges under climate change. Developing climate-smart agricultural practices need process-based agroecosystem models which better simulate crop production and greenhouse gas emissions simultaneously. However, existing models often prioritize one aspect while oversimplify the other. Here, we develop an agroecosystem model, the MCWLA 2.0, which integrates the process-based crop model MCWLA for simulating crop growth with an improved microbial-implicit and microbial-explicit methods for simulating soil processes, to better simulate crop-soil interactions and N2O emissions. The model accounts for the key aboveground and underground processes in agroecosystem, including crop growth, agricultural management, soil carbon and nitrogen cycle, and abiotic stresses from water, temperature and nitrogen. It simulates the nitrification and denitrification processes in a microbial-explicit way. We demonstrate the model in simulating the dynamics of soil environment, nitrogen, N2O emissions and crop growth in maize-wheat rotation system, using the field experimental observations of 29 treatments from eight field experiments (spanning 1-4 wheatmaize rotations) at five sites across China. The model is able to capture fairly well the daily dynamics of soil moisture, soil temperature, soil nitrogen and N2O emissions, as well as crop yield and N2O emissions at seasonal scale. We indicate that MCWLA 2.0 is an effective tool for simulating crop-soil interactions and N2O emissions and developing climate-smart agricultural practices.