: The quasi-degenerate perturbation theory (QDPT) with complete active space (CAS) self-consistent field (SCF) reference functions is extended to the general multiconfiguration (MC) SCF references functions case. A computational scheme that utilizes both diagrammatic and sum-over-states approaches is presented. The second-order effective Hamiltonian is computed for the external intermediate configurations (including virtual or/and core orbitals) by the diagrammatic approach and for internal intermediate configurations (including only active orbitals) by the configuration interaction matrix-based sum-over-states approach. The method is tested on the calculations of excitation energies of H2O, potential energy curves of LiF, and valence excitation energies of H2CO. The results show that the present method yields very close results to the corresponding CAS-SCF reference QDPT results and the available experimental values. The deviations from CAS-SCF reference QDPT values are less than 0.1 ...