The hydrogenation of hydrogen cyanide to methylamine on Ni(111) has been studied as a model reaction for the hydrogenation of nitriles to primary amines, using density functional theory. Hydrogen cyanide adsorbs strongly on Ni(111) with an adsorption energy of -1.50 eV with the CN bond parallel to the surface. The product of the hydrogenation reaction, methylamine, is relatively weakly adsorbed on the surface compared with the hydrogen cyanide, with an adsorption energy of -0.56 eV, very similar to the adsorption energy of ammonia, -0.41 eV. The hydrogenation reaction goes through an imine intermediate (H2CNH) independently of whether hydrogen reacts with the carbon atom or nitrogen atom of the hydrogen cyanide molecule in the first hydrogenation step. From the imine intermediate, the hydrogenation reaction is likely to proceed via a H3CNH species to methylamine (H3CNH2). On the other hand, if we explore the backward reaction, methylamine decomposition on Ni(111), our calculations show that CH bond cleavage is slightly favored over NH bond-breaking, leading to the formation of H2CNH2.