Microbialites and microbial mats are complex communities with high phylogenetic diversity. These communities are mostly composed of bacteria and archaea, which are the earliest living forms on Earth and relevant to biogeochemical evolution. In this study, we identified the shared metabolic pathways for uptake of inorganic C and N in microbial mats and microbialites based on metagenomic data sets. An in silico analysis for autotrophic pathways was used to trace the paths of C and N to the system, following an elementary flux modes (EFM) approach, resulting in a stoichiometric model. The fragility was analyzed by the minimal cut sets method. We found four relevant pathways for the incorporation of CO2 (Calvin cycle, reverse tricarboxylic acid cycle, reductive acetyl-CoA pathway, and dicarboxylate/4-hydroxybutyrate cycle), some of them present only in archaea, while nitrogen fixation was the most important source of N to the system. The metabolic potential to incorporate nitrate to biomass was also relevant. The fragility of the network was low, suggesting a high redundancy of the autotrophic pathways due to their broad metabolic diversity, and highlighting the relevance of reducing power source. This analysis suggests that microbial mats and microbialites are "metabolic pumps" for the incorporation of inorganic gases and formation of organic matter.