Approximate analytical solutions of the Dirac equation are obtained for some diatomic molecular potentials plus a tensor interaction with spin and pseudospin symmetries with any angular momentum. We find the energy eigenvalue equations in the closed form and the spinor wave functions by using an algebraic method. We also perform numerical calculations for the Poschl-Teller potential to show the effect of the tensor interaction. Our results are consistent with ones obtained before.