I came up with a solution to this for a tabletop RPG homebrew some years ago.
Quite simply, the mech's limbs used hydraulic actuators as muscles, and its power source provided torque to a hydraulic pump.
The pilot would be suspended in the cockpit, strapped into a frame or anchored to a frame that engages with sockets in their form-fitting plate armour, the movement of the frame causing the mech to mimic the movement of the pilot.
The power source varied. Some mecha used a diesel radial engine to drive the hydraulic pump (a radial engine is wide and flat, and leaves more room in the torso for the cockpit). However, endurance was limited to around a day of activity before they had to be refueled.
I also came up with a couple of atomic power sources that relied upon the magical nature of my world. They would provide years of endurance, but were considerably more expensive than a radial engine and a supply of diesel fuel that would last an equivalent duration.
One was Tremium, a hard, brittle greenish metallic element. When it fissioned, it would release some heat, and a burst of kinetic energy in a random direction, unless there was a sufficiently powerful magnetic field nearby, in which case, the kinetic burst would be directed along the magnetic lines of force. The kinetic burst also increased the liklihood of neighbouring Tremium atoms to fission. By putting Tremium and magnets around the edge of a stack of flywheels, and arranging a governor mechanism to control the gap between flywheels proportional to the speed of the flywheel stack, a self-regulating reaction could be sustained, and controlled by altering the governor setting. In the event of governor failure due to battle damage, the flywheel "pancakes" could collapse together, resulting in a runaway reaction that might either melt down the reactor, or result in the flywheels exploding due to a purely mechanical failure of their structure, or heat demagnetisation of the permanent magnets next to the Tremium on the flywheel rim leading to chaotic, rather than directed, energy release. Despite its more favourable properties as a kinetic power source, Tremium was particularly hazardous to human health if not stored properly. If Tremium dust was inhaled, its spontaneous decay would slowly but surely tear apart its victim's lungs... and the brittle nature of both it and its ore meant that chaotic decay was highly likely to cause fractures and release dust. It was commonly stored in either magnetized containers in small quantities, or in wax-filled containers.
The other atomic power source was an element called Fulminium, an orange crystalline substance with semiconductive and piezoelectric properties. When it decayed, it would emit some heat, light in the orange and ultraviolet frequency ranges, and electrons, and by compressing the crystals between conductive plates of dissimilar metals, a direct electrical current could be tapped. Fulminium was stimulated to decay by ultraviolet light. A reaction could be regulated by placing a crystal in a chamber with reflective walls and movable black shutters; by controlling the shutters, the reaction could be controlled. In mecha, that electrical current could be used to power electric motors, which would drive the hydraulic pump. Fulminium was a somewhat more risky substance to use, as its decay products were opaque, and as a reactor crystal aged, it became increasingly more likely that the impurities would absorb some of the light energy and convert it into heat, to the point where the crystal would explode. This led to fairly frequent reprocessing of Fulminium reactor crystals to extract the impurities. It was considerably safer to mine Fulminium ore than Tremium ore, though occasionally electrical charges would build up to the point where they would emit bolts of lightning, unless the ore vein was grounded.