Preheat the oven to 350°F (175°C) and line a standard 12-cup muffin tin with paper liners.
To prepare the cupcakes, whisk the espresso powder into the brewed coffee until fully dissolved. Stir in the milk and vanilla extract, then set this mixture aside.
In a medium bowl, sift together the flour, cocoa powder, baking powder, baking soda, and salt.
Using an electric mixer on medium speed, beat the butter and both sugars until the mixture is light and fluffy, about 3 minutes. Add the egg and mix until just combined. Lower the mixer speed to low and gradually add the dry ingredients in three parts, alternating with the coffee mixture in two parts, mixing each addition until just combined. Finish by folding the batter gently with a rubber spatula to ensure everything is evenly incorporated.
Spoon the batter into the prepared muffin cups, filling each about two-thirds full. Bake for 17 to 20 minutes, or until a toothpick inserted in the center comes out clean. Allow the cupcakes to cool completely before frosting.
For the frosting, whisk the espresso powder into the vanilla extract in a small bowl until dissolved and set aside.
Using the whisk attachment of a stand mixer, beat the butter on medium-high speed for 5 minutes, scraping down the sides once halfway through. Reduce the speed to low and gradually add the powdered sugar, adding a little at a time and waiting until mostly incorporated before adding more. Once all the powdered sugar is added, scrape the bowl and increase the speed to medium-high, whipping the frosting until light and fluffy, about 1 to 2 minutes. Add the espresso-vanilla mixture and continue mixing on medium-high until fully combined, scraping the bowl as needed.
Frost the cooled cupcakes as desired (a Wilton 1M decorating tip works beautifully for piping swirls).