Logging macros for a portion of a recipe is something I'm asked about a lot from clients who are just learning to track macros!
To do this, import or manually enter the recipe into MyFitnessPal and enter the total weight of the prepared food in grams as the number of servings for the recipe.
For example, I made a pot of black bean soup for dinner for the family last night. The total weight of the soup (minus the pot) was 2460 grams. I entered 2460 as the number of servings for the recipe in MyFitnessPal:
This means that 1 gram = 1 serving.
To log my portion, I weighed out 350 grams and logged it as 350 servings:
As you can see, this recorded the calories and macros for portion I ate.
Here is a screen recording with a bit more detail (sound on, please!):