The theory of LF in MMT:
https://alpha.tntbase.mathweb.org/repos/oaff/urtheories/source/lf.mmt

The Scala/MMT implementation of the LF rules:
https://svn.kwarc.info/repos/MMT/src/mmt-lf/src/info/kwarc/mmt/lf/Rules.scala