In a 12-ounce microwave-safe mug, whisk together the flour, sugar, cocoa powder, espresso powder, baking powder, and salt until no lumps remain and the dry ingredients are evenly distributed.
Add the milk, vegetable oil, egg yolk, and vanilla extract to the mug. Stir vigorously with a fork for 30-45 seconds until the batter is completely smooth and no streaks of flour remain on the bottom or sides.
If using chocolate chips, fold them into the batter and tap the mug gently on the counter to release any air bubbles.
Microwave on high power for 60-90 seconds, watching carefully. The cake is done when it rises significantly and the top looks mostly set with a slightly shiny center. Start checking at 60 seconds; add 10-second intervals if needed based on your microwave's power.
Let the mug cake rest for 1 minute after microwaving—it will continue cooking from residual heat and the texture will firm up slightly.
Serve immediately while warm, eating directly from the mug or turning out onto a small plate. Top with whipped cream, ice cream, or enjoy as is.