Place a medium nonstick skillet over low heat and add the basil pesto.
Warm the pesto gently until it begins to shimmer and lightly bubble. Avoid using high heat, as pesto can scorch quickly.
Crack the eggs directly into the pesto, leaving a little space between them.
Cover the skillet and cook over low heat for about 2 minutes, or until the egg whites are set while the yolks remain soft.
If you prefer firmer yolks, continue cooking for another 1–2 minutes.
Season the eggs lightly with salt, black pepper, and red pepper flakes or Aleppo pepper.
If serving with toast, spoon a small amount of pesto from the skillet over each slice.
Arrange the sliced tomato and mozzarella on the toast.
Carefully slide the cooked eggs over the tomato and mozzarella.
Spoon the remaining warm pesto over the top and serve the Pesto Eggs Recipe immediately.