Set your oven to 375°F and let it fully heat up before you start assembling. A properly preheated oven ensures the eggs cook evenly and set at the right pace, so don't skip this step even if you're in a hurry.
Lightly coat a 12-cup muffin tin with cooking spray or a light brush of oil. This keeps the ham from sticking to the metal once baked. A well-greased tin also makes cleanup and removal so much easier later on.
Press one slice of ham into each muffin cup, molding it gently so it forms a little cup shape. The ham acts as the edible container that holds the cheese and egg, so make sure it covers the bottom and sides as much as possible.
Divide the mozzarella cheese evenly among the 12 cups, sprinkling it right on top of the ham. The cheese melts into the egg as it bakes, creating that gooey, savory bite in the center of every cup.
Crack one egg directly into each ham-lined cup, right on top of the cheese. Season each one with a pinch of salt and pepper. If you prefer a more uniform texture, whisk the eggs lightly before pouring instead of cracking them whole.
Slide the tin into the oven and bake for 15 to 18 minutes. The shorter time gives you a softer, jammier yolk, while the full 18 minutes cooks the eggs through completely. Keep an eye on them near the end so they don't overcook.
Once out of the oven, let the egg cups cool for a minute or two before topping with sliced green onions. Run a butter knife around the edges if any cups are sticking, then pop them out and serve warm.