  Solid MgB$_2$ has rather interesting and technologically important
properties, such as a very high superconducting transition temperature.
Focusing on this compound, we report the first non-trivial application of a
novel density-functional-type theory for superconductors, recently proposed by
the authors. Without invoking any adjustable parameters, we obtain the
transition temperature, the gaps, and the specific heat of MgB$_2$ in very good
agreement with experiment. Moreover, our calculations show how the Coulomb
interaction acts differently on s and p states, thereby stabilizing the
observed superconducting phase.
