Probably not when you first wake up:
[I]f we are drinking caffeine at a time when your cortisol concentration in the blood is at its peak, you probably should not be drinking it. This is because cortisol production is strongly related to your level of alertness and it just so happens that cortisol peaks for your 24-hour rhythm between 8 a.m. and 9 a.m. on average (Debono et al., 2009). Therefore, you are drinking caffeine at a time when you are already approaching your maximal level of alertness naturally. …
Although your cortisol levels peak between 8 a.m. and 9 a.m., there are a few other times where–on average–blood levels peak again, like between noon and 1 p.m., and between 5:30 p.m. and 6:30 p.m. In the morning then, your coffee will probably be the most effective if you enjoy it between 9:30 a.m. and 11:30 a.m., when your cortisol levels are dropping before the next spike.