01 - Preheat oven to 350°F (175°C) and line a 12-cup muffin tin with paper liners.
02 - In a medium bowl, whisk together flour, baking powder, baking soda, salt, and pumpkin pie spice until well blended.
03 - In a large bowl, whisk together coffee, pumpkin purée, granulated sugar, brown sugar, vegetable oil, eggs, and vanilla extract until smooth.
04 - Add the dry mixture to the wet ingredients and stir until just combined. Do not overmix to maintain tenderness.
05 - Divide the prepared batter evenly among the lined muffin cups, filling each about two-thirds full.
06 - Bake for 18 to 20 minutes until a toothpick inserted into the center of a cupcake comes out clean. Allow cupcakes to cool completely before frosting.
07 - In a large bowl, beat the softened butter until creamy using an electric mixer. Add powdered sugar, cocoa powder, espresso powder, milk, vanilla extract, and salt. Begin mixing on low speed until combined, then increase speed and beat for about 2 to 3 minutes until the frosting is light and fluffy. If necessary, add extra milk 1 teaspoon at a time to adjust consistency.
08 - Pipe or spread the mocha frosting onto the cooled cupcakes. Optionally, dust with cocoa powder or sprinkle with pumpkin pie spice for decoration.