Purée the mushrooms with the stock or Madeira in a blender or in a tall, narrow container with an immersion blender.
Combine the puréed mushrooms, lemon juice, xanthan gum, if using, and butter in a straight-sided sauté pan. Cook the purée until all the moisture evaporates.