In a large microwave-safe mug, whisk together the almond flour, cocoa powder, erythritol, baking powder, and a pinch of salt with a fork until there are no lumps.
Add the egg, melted butter, heavy cream, and vanilla extract. Stir vigorously with the fork until the batter is completely smooth and uniform in color.
Microwave on high for 90 seconds. The cake should be risen and set on top but still slightly moist in the center. If still wet, microwave in 10-second bursts.
Let the mug cake rest for 1 minute before eating. This resting time lets the center finish cooking gently without drying out.
Top with a dollop of whipped cream or a small square of butter and enjoy straight from the mug.