The accelerated air coming out has more energy than the air ahead of the engine, even at idle-power.
In constant speed level flight, the forward thrust acting on the jet engine(s) equals all the drag forces acting rearward on the airplane.
The thrust acting forward equals the force the mass flow rate exerts rearward. Neither is the cause (action) nor the effect (reaction), since it's a two-body system (engine and air).
The forces are perfectly simultaneous, and are there for the same reason.
The energy bit:
Energy (work) equals force times displacement.
A non-accelerating plane in mid-air, or a jet engine running on a fixed test stand, still has moving parts and a moving [steady] exhaust: displacement is happening.
Since we can't create energy and it has to be conserved:
Let's say the total energy leaving the combustor (heated accelerated dense air) is 10 pirate-ninjas, then say 5 of which drive the turbine and all what's connected to it (including the air at the compressor). The other 5 leave the engine as an accelerated jet of air.
Say the compressor transfers 3 to the air, and all parts use 2 to rotate. The air comes with its 1 pirate-ninja of stored energy. The 3 gained by the air, now 4, meet the fuel in the combustor and release 10 (perfect lossless combustion, sorry). So, the energy stored in the fuel before combustion is 6.

(Own work)
The turbine-shaft-compressor is one body, the turbine absorbs 5, and transfers 3 of those to the air via the compressor, i.e., the engine parts absorb 2 to rotate, this is what you referred to as mechanical energy.
In other words—
The engine added 4 pirate-ninjas to the air from start to finish, giving the air added kinetic energy (mass flow rate), which translates to forward force as explained early on. In doing so, the engine spent 6 fuel, 2 of which to purely rotate the engine shaft, the other 4 went to the Δ mass flow rate.
The ratios above are not real, only illustrative. If you add more fuel, more energy will be released (excess oxygen is still available, that's how afterburners work), this energy will spin the engine faster, bringing in more air for a better efficient cool combustion.
The more efficiently the fuel energy is extracted, the more thrust we get. The properties of the air will have an impact; how dense is it, is the engine running on the ground, or is the plane transferring some of its kinetic energy into steady air resulting in ram-air energy, and so on.
So the ratios/percentages are not fixed, they depend on the operating conditions as well as the engine design (e.g., bypass ratio, compression ratio, etc.); even for the same type, different variants have different number of stages.