An N-rich metal-organic framework with an rht topology: high CO2 and C2 hydrocarbons uptake and selective capture from CH4.