The contact impact problem in planar multibody systems can be efficiently solved by formulating it as the linear complementarity problem, which requires a complex modeling process. To simplify the process, a recursive algorithm for the dynamics of planar multibody systems with frictional unilateral constraints is proposed based on the reduced multibody system transfer matrix method. Firstly, the contact forces of frictional unilateral constraints are integrated into the recurrence relations of system components using Lagrange multipliers. Subsequently, the relative motion equations of the contact positions are discretized in time, which are then utilized to describe the linear complementarity problem for systems. The dynamics of the system is solved by the Moreau time-stepping method with the recursive method. Finally, the proposed algorithm was validated using the woodpecker toy and used to model a slider-crank mechanism with clearance, which shows its characteristics of facilitating modeling, universal, and highly programmable. This recursive algorithm provides an effective tool for solving non-smooth planar multibody systems while extending the application of the multibody system transfer matrix method.