Pcos in women

I was told I have pcos. I've researched and everything says to take metformin. Can a gynocologist prescribe metformin or does a regular dr have to? 
​