Is cocaine the most potent stimulant of natural origin and used medically?

Is cocaine the most potent stimulant of natural origin? Perhaps. This depends on what you would call 'most potent'. Khat, for instance, contains naturally occuring forms of amphetamine. Is that a more potent stimulant? Neither cocaine nor the amphetamine in Khat would be as potent if it wasn't refined, after all.

Is cocaine used medically? Yes. There is clinical use of cocaine as a local anesthetic, particular in Ear, Nose and Throat surgery(ophthalmology) as it is also an vasoconstrictor. Beyond this, there are modern studies that show that coca, if not cocaine, have various medical potentials.