Heat a skillet over medium heat, then cook the mushrooms, onion, and garlic until soft, about 5 minutes. Put the vegetables and tofu in a food processor or blender and purée until smooth. Add the walnuts, parsley, salt, and pepper and purée for another 5 minutes.
Serve either immediately while warm or chill and serve as a pâté.