Many kinds of mechanical systems can be modeled as spatial rigid multibody systems (SR-MBS), which consist of a set of rigid bodies interconnected by joints, springs and dampers. Vibration calculation of SR-MBS is conventionally conducted by approximately linearizing the nonlinear equations of motion and constraint, which is very complicated and inconvenient for sensitivity analysis. A new algorithm based on constraint-topology transformation is presented to derive the oscillatory differential equations in three steps, that is, vibration equations for free SR-MBS are derived using Lagrangian method at first; then, an open-loop constraint matrix is derived to obtain the vibration equations for open-loop SR-MBS via quadric transformation; finally, a cut-joint constraint matrix is derived to obtain the vibration equations for closed-loop SR-MBS via quadric transformation. Through mentioned above, the vibration calculation can be significantly simplified and the sensitivity analysis can be conducted conveniently. The correctness of the proposed method has been verified by numerical experiments in comparison with the traditional approaches.