The Church only requires abstaining from meat. On fast days, the Church ordinarily expects Catholics to eat one normal meal and two small meals. If you would ordinarily drink coffee with your meal, it is fine to do so on fast days. If you need coffee for a medicinal purpose – for example, you would get a “caffeine headache” without it – you could drink coffee for that purpose. The spirit of the fast though would seem to suggest that you should not abuse that allowance by using “medicinal reasons” as an excuse to drink as much coffee as you like. It would be better to just drink enough to avoid the headache and no more than that.