The mechanical behavior of multibody systems can be modeled with several numerical methods. One can mention the Multibody Dynamics (MBD), the Finite Element Method (FEM), the Discrete Element Method (DEM) among others, which have the common feature of solving for the dynamics of a system of rigid/flexible bodies. In this context, the mechanical contact interaction between bodies has to be considered in the model. First, one needs to adopt a strategy to seek for contact occurrence and, when it is detected, to evaluate and include contributions into the mathematical model. However, handling contacts in such models is not a straightforward task, as they can be numerous (depending on the number of bodies considered in the model) and complex, due to the particularities in the geometric shape that each body presents, influencing in contact detection and in its inclusion, as a contribution into the model. In this work, we propose an integrated framework for handling and managing the automatic contact detection between bodies within a whole complex multibody system. Both rigid and flexible bodies can be considered. Strategies such as MBD, FEM and DEM can be employed together with the proposed strategy. Pointwise contact interactions are modeled based on the geometric description of each body's boundary, with the aid of the master–master contact formulation. A hierarchy of bounding volumes for the collision detection is employed, ruling the creation of a contact–candidates pairs list, for which the Local Contact Problem (LCP) is solved — as a detailed determination for the contact pointwise location on local surface parameterizations, representing bodies' boundaries. As the contact interface, we employ a particular hybrid law that can represent a classical linear contact stiffness, Hertzian contact and other possibilities, together with a barrier to avoid penetration between bodies. We show applications of the technique involving general rigid polyhedra in contact with beam finite elements — as a FEM/DEM coupling, such as rolling rigid bodies, as a classical multibody dynamics application. The herein proposed strategy can be incorporated using distinct time-integration solvers, such as it is independent on MBD/FEM/DEM particularities. [ABSTRACT FROM AUTHOR]