I won't be able to provide a particularly comprehensive answer here, but I'll throw in my two cents.
In one of my worlds I came up with the idea of an ecosystem filled with animals that, like you describe in your question, are 'mechanical', utilizing structures like gears, wheels, springs, and pulleys in their biology. As I understand it, the reason we almost never see these structures in real-world animals, at least for wheels and pulleys (and freely rotating gears), is that they require the structure to be disconnected from the rest of the animal's body, which means the part cannot receive nutrients. This adds a significant, and potentially insurmountable, layer of evolution complexity, as the part needs to be grown from something like keratin and then disconnected. Resultantly, legs dominate and likely prevent such unnecessarily complex structures from ever evolving.
The way this is overcome in my world is through the magic system, which allows an animal to use aura (magic stuff, basically mana) to transfer energy to body parts disconnected from the circulatory system, allowing separate body parts to grow and heal. So, if the world you are building is one in which magic exists, making 'the ability to transfer energy from one part of the body to another' an aspect of the system seems the simplest way, as it drastically reduces the barriers toward the evolution of mechanical structures.
If your world does not have magic, the only method I can think of would be for your animals to have structures that let them transmit and receive radio waves or microwaves, which would let them transfer energy to disconnected body parts. On the receiving end, I would expect something somewhat analogous to chlorophyll, in that there is a compound that converts incoming electromagnetic energy (photons) into chemical energy. I have no idea what the transmitting end would look like. You should also note that this suggestion is incredibly handwavey, as there would be massive conversion losses in the process that would make it unlikely to evolve (and no doubt issues with receiving low-frequency photons). But at the very least, it's an explanation that sounds somewhat plausible. It would also have interesting implications for how your animals could communicate, as they may do so using radio waves.