The cohesive and elastic properties of the non-oxide perovskite type superconductor MgCNi3 are calculated using the full-potential linear muffin-tin orbital method with the local density approximation as well as the generalized gradient approximation for exchange and correlation. The calculated equation of state and ground state properties (equilibrium lattice constant, bulk modulus and its pressure derivative) agree well with recent experiments. From the elastic constants the Young's modulus, shear modulus, Poisson's ratio, sound velocities and Debye temperature are obtained. By analysing the ratio between bulk modulus and shear modulus we conclude that MgCNi3 is intermediate between brittle and ductile in nature. © IOP Publishing Ltd.