The hydrogen adsorption and desorption properties of a microporous metal–organic framework, magnesium formate, are investigated. The material has channel-like pores of approximately 3.4 Å diameter. The pore size is below the kinetic diameter of nitrogen and causes a breakdown of the linear relationship between maximum hydrogen uptake and specific surface area measured by nitrogen adsorption. From the experimental isotherms the isosteric heat of adsorption for hydrogen is calculated with very high accuracy over a wide range of surface coverage, up to 80 %. The isosteric heat of adsorption is 6.5–7 kJ mol−1 which is one of the highest values ever observed over the whole range of surface coverage.