Ab initio molecular dynamics simulations of CH4 and CO2 on the calcite (104) surface have been carried out for the molecular level analysis of CO2-enhanced gas recovery process (EGR). This process takes advantage of the stronger interaction of CO2 with the reservoir walls compared to CH4, therefore can improve the extraction of the latter, while at the same time sequestering the former underground. Pure and mixed gases were considered and the temperature effect on the systems behavior was analyzed. For pure gases, carbon dioxide shows great stability on the surface in the studied temperature range, while methane molecules start leaving the surface at 298 K. For gas mixtures, the reported results confirm that for low to medium concentrations, a temperature of 373 K could determine the best methane extraction efficiency, as CH4 interaction with the surface is quite weak and carbon dioxide binds strongly on the surface. On the other hand, when full coverage is achieved, the best efficiency is reached for the highest temperature. Finally, when considered a 2:2 gas layer, carbon dioxide tends to adsorb preferentially to the surface while methane keeps floating above it, thereby reducing its chance to be adsorbed back. These results reveal nanoscopic details for the design of suitable EGR processes.