The push to control the greenhouse gas emissions is motivated by environmental regulations. For the aim to be achieved, the suggestion of eliminating or at least reducing gas flaring is currently taken under environment. In this regard, a new configuration for flare gas treatment is proposed in this study. This configuration is aimed to collect H2 and CO2 from flare gas, simultaneously. The collected components would be sent to the methanol synthesis reactor in the upstream section. The proposed configuration is made up of a multi-step membrane-assisted separation unit. In order to clarify what lies behind the idea, we proposed a mathematical formulation which is composed of conservation equations and kinetic rate equations is developed. H2 and CO2 elimination in the first step followed by a membrane-assisted water gas shift reactor for catalytic CO conversion and H2 recovery in tandem, and removing the remaining CO2 in the supplementary step is investigated numerically. The collected H2/CO2 mixture is aimed to recover into the upstream methanol synthesis reactor. The obtained results reveal that by utilizing such a strategy, about 2500 kmol/day CO2 (almost 98% of total input) is eliminated from the flare gas stream. Moreover, by considering the converted CO, about 4050 kmol/day CO2 is recovered to the methanol reactor. As a whole, 0.68% enhancement in the methanol generation and the reduction of about 4050 kmol/day flare gas pollutants are achieved in tandem when 98% N2 and 92.9% CH4 is separated the from purge gas.