We report that ammonia borane with a high uptake capacity for hydrogen can be encapsulated in a metal-organic framework (MOF) via capillary action, where the MOF functions as a chemical guide to control the hydrogen desorption pathways of ammonia borane by releasing only pure hydrogen, lowering its hydrogen desorption temperature, and suppressing its volumetric expansion during hydrogen desorption.