Spent coffee grounds (SCGs) are a promising material for sustainable preparation of biodiesel. This study proposed a new approach for biodiesel synthesis from wet SCGs using 1,8-diazabicyclo[5.4.0]undec-7-ene (DBU) as both a green solvent and catalyst. The optimal reaction conditions were determined as a methanol amount of 6.25 mL/g of wet SCGs, DBU amount of 14.46 mL/g of wet SCGs, temperature of 60.2 °C, and reaction time of 28.65 min through response surface methodology. Under these conditions, the maximum biodiesel yield was 97.18%. Notably, DBU polarity could be regulated reversibly, facilitating its reusability and a simple process for product separation. Under optimal conditions, DBU could be potentially reused for at least 10 cycles to yield high amounts of biodiesel. This study suggests that the switchable solvent-assisted direct transesterification of wet SCGs is a potential, efficient, cost-effective, and eco-friendly approach for biodiesel synthesis.