Minimally invasive surgery offers several advantages, including reduced blood loss, smaller incisions, less pain, and a lower risk of complications than open surgery. This approach enhances patient comfort and supports faster recovery. When guided by optimal path planning, surgical robots can accurately navigate the body to remove malignant tumors with high precision. This study proposes a Modified Particle Swarm Optimization (MPSO) algorithm to determine the optimal path for robotic-assisted minimally invasive surgery targeting brain tumors. The algorithm improves upon standard PSO by modifying the velocity update equation and incorporating an adaptive inertia weight, enhancing convergence speed, global search ability, and solution accuracy. Experimental results show that the proposed MPSO achieves a maximum fitness value of 19.10 in a sparse obstacle environment, outperforming standard PSO and IPSO in quality and in the required number of iterations. The approach effectively balances path efficiency and obstacle avoidance, making it well-suited for complex surgical scenarios. In conclusion, the MPSO-based method provides a reliable and precise solution for robotic surgical navigation, improving outcomes and safety in minimally invasive procedures.