The heat engine of magnetic black holes in Einstein-AdS gravity coupled to rational nonlinear electrodynamics, as the working substance, is studied. The dynamical negative cosmological constant is considered as a thermodynamic pressure. We investigate the efficiency of black hole heat engines in extended space thermodynamics for rectangle closed path in the P−V plane and the maximally efficient Carnot cycles. The exact efficiency formula which is written in terms of the mass of the black hole is obtained. It was demonstrated that the black hole efficiency decreases when the nonlinear electrodynamics coupling increases and the black hole efficiency increases if the magnetic charge increases. The relation between the efficiency, event horizon radiuses (entropy) and pressure is obtained. We study an efficiency of the holographic heat engine of a cycle in the vicinity of a critical point. Thus, the heat engine of our model can produce work.