A new direct relativistic four-component Kramers-restricted multiconfiguration self-consistent-field (KR-MCSCF) code for molecules has been implemented. The program is based upon Kramers-paired spinors and a full implementation of the binary double groups (D2h* and subgroups). The underlying quaternion algebra for one-electron operators was extended to treat two-electron integrals and density matrices in an efficient and nonredundant way. The iterative procedure is direct with respect to both configurational and spinor variational parameters; this permits the use of large configuration expansions and many basis functions. The relativistic minimum-maximum principle is implemented in a second-order restricted-step optimization algorithm, which provides sharp and well-controlled convergence. This paper focuses on the necessary modifications of nonrelativistic MCSCF methodology to obtain a fully variational KR-MCSCF implementation. The general implementation also allows for the use of molecular integrals from a two-component relativistic Hamiltonian as, for example, the Douglas-Kroll-Hess variants. Several sample applications concern the determination of spectroscopic properties of heavy-element atoms and molecules, demonstrating the influence of spin-orbit coupling in MCSCF approaches to such systems and showing the potential of the new method.