  We have investigated electronic structures of a newly discovered
antiperovskite superconductor MgCNi$_3$ and related compounds MgBNi$_3$ and
MgNNi$_3$. In MgCNi$_3$, a peak of very narrow and high density of states is
located just below $\rm E_F$, which corresponds to the $\pi^*$ antibonding
state of Ni-3d and C-$2p$ but with the predominant Ni-3d character. The
prominent nesting feature is observed in the $\Gamma$-centered electron Fermi
surface of an octahedron-cage-like shape that originates from the 19th band.
The estimated superconducting parameters based on the simple rigid-ion
approximation are in reasonable agreement with experiment, suggesting that the
superconductivity in MgCNi$_3$ is described well by the conventional phonon
mechanism.
