  We introduce and study certain hyperbolic versions of automorphic Lie
algebras related to the modular group. Let $\Gamma$ be a finite index subgroup
of $\mathrm{SL}(2,\mathbb{Z})$ with an action on a complex simple Lie algebra
$\mathfrak g$, which can be extended to $\mathrm{SL}(2,\mathbb{C})$. We show
that the Lie algebra of the corresponding $\mathfrak{g}$-valued modular forms
is isomorphic to the extension of $\mathfrak{g}$ over the usual modular forms.
This establishes a modular analogue of a well-known result by Kac on twisted
loop algebras. The case of principal congruence subgroups $\Gamma(N), \, N\leq
6$ are considered in more details in relation to the classical results of Klein
and Fricke and the celebrated Markov Diophantine equation. We finish with a
brief discussion of the extensions and representations of these Lie algebras.
