To tackle task offloading and path planning challenges in multi-UAV-assisted mobile edge computing, this paper proposes a task offloading and path optimization approach via multi-agent deep reinforcement learning. The primary goal is to minimize the overall energy consumption of the system and improve computational performance. Initially, we established a model for a multi-UAV-assisted mobile edge computing system that centrally manages the UAV network through software-defined networking technology. Subsequently, considering UAV load and fairness in user equipment-related services, we employ the multi-agent deep deterministic policy gradient algorithm to optimize task offloading and UAV path management, aiming at load balancing and reducing overall system energy consumption. Simulation results demonstrate our method’s effectiveness in reducing energy consumption and computation latency compared to benchmark algorithms. It ensures system efficiency, stability, and reliability, meeting mobile edge users’ service requests while utilizing computing resources efficiently.