Melt the butter in a saucepan and add the onion. When wilted, add the mushrooms and cook until they give up their liquid. Cook until the liquid evaporates. Sprinkle with salt and pepper.
Sprinkle with flour, stirring with a wire whisk. When blended, add the stock, stirring rapidly with the whisk. When blended and smooth, continue cooking, stirring occasionally, about 15 minutes. Add the cream and simmer about 5 minutes longer.