This paper proposes a new wireless sensor routing algorithm by combining the ant colony algorithm with the mobile agent technology. This algorithm considers the distance and path energy overhead among nodes and residual node energy, equalizes the energy overhead in the network, improves the update rule of the ant colony information elements and speeds up convergence of the ant colony algorithm to get the optimal values. The simulation results indicate that this algorithm can improve the globalization and convergence speed, effectively reduce redundant data transmission and communication overhead, extend the network lifecycle and be very suitable for a large-scale wireless sensor network compared to other mobile agent routing algorithms.