  Randomness is a potential resource for cryptography, simulations and
algorithms. Non-local correlations violating Bell's inequality certify the
generation of bit strings whose randomness is guaranteed in a
device-independent manner. We provide interesting semi-device independent
randomness certification protocols by Kochen-Specker (KS) contextuality. For
this, we first cast the Mermin's magic-square proof of KS contextuality for
two-qubit system as a semi-device independent communication game in
prepare-measure scenario. This provides a semi-device independent certification
of two-bit of randomness. Further, by using Mermin's magic-star proof of KS
theorem involving three-qubit system, we certify three-bit of randomness. We
conjecture that our proposals can be extended to certify any arbitrary bit of
randomness through a suitable KS proof of contextuality valid for higher
dimensional system.
