We consider an MP-system, that is, a compact Riemannian manifold with boundary, endowed with a magnetic field and a potential. On simple MP-systems, we study the MP-ray transform in order to obtain new boundary rigidity results for MP-systems. We show that there is an explicit relation between the MP-ray transform and the magnetic one, which allows us to apply results from magnetic systems to our case. Regarding rigidity, we show that there exists a generic set of simple MP-systems, which is open and dense, such that any two MP-systems close to an element in it and having the same boundary action function, must be k-gauge equivalent.