You have two problems here, one easy and one hard. The easy one is "how many servings are in this recipe?" As others have said, the recipe may make 36 cookies but is that 36 servings, or 12, or some other number? That is the easy problem in my opinion. Many recipes say "serves 8" or "serves 6" and you could work out the total numbers for if someone ate the entire batch, then calculate "I can't eat more than 2 of these" or "I should eat at least half of this to get enough protein" as needed.
The harder part is taking raw numbers like how much protein is in an egg or how many calories are in a cup of flour and working out how to combine them. Say you are frying chicken in 1/4 cup of oil. You certainly don't add the oil calories to the chicken calories - not all the oil ends up in the dish. But if you add oil to a cake batter, you will add the oil calories in to the calculation. Some forms of cooking affect some nutrients, so perhaps the Vitamin C in a long cooked fruit dish is not the same as the Vitamin C in the raw fruit you added to it. I don't know a general solution or technique for dealing with this. It depends what nutritional facts you care about (calories? fibre? fat? Vitamin C? B? E?) and how you are cooking the food. In addition if you are using "one apple" or "two carrots" you won't have the same precision as "100g of diced carrot" so your recipe may not be the same every time.
If you just want to know roughly the calories, just add up the calories of the raw ingredients and make some adjustments for ingredients that don't end up in your mouth. Beyond that I don't think it's possible.