Hi Tom,
I don’t believe there is a direct route. So, you’ll first have to travel to another city closer to the border crossing, which is called Paso Canoas. I think there is a bus from Uvita to Palmar and from there you can catch another to Paso Canoas. From Paso Canoas there are regular buses to David.
This is a great website with bus schedule for Costa Rica and other countries. But be sure to call the bus company listed on the route as schedules change and they’re not always updated immediately on the site.
thebusschedule.com