Preheat oven to 400°f. For filling, in a large skillet, heat butter over medium heat. Add mushrooms and onion; cook and stir until tender, 3-5 minutes. Add garlic and pepper; cook 1 minute longer. Stir in cream cheese until melted; remove from heat.
Unfold each pastry sheet; cut into 8 squares, 16 total. Add prepared filling equally to the squares. Top with shredded cheese, about a tablespoon per square, or less if you prefer. To prepare an egg wash, stir up an egg well with 1 tsp. of water. Brush edges of pastry with egg wash. Place 2 inches apart on parchment-lined baking sheets.
Bake until golden brown, 13-15 minutes. Remove from pans to wire racks. Serve warm.