Gather all ingredients. Preheat the oven to 350 degrees F (175 degrees C). Grease a 8x8-inch baking pan.
Melt butter in a skillet over medium heat. Add onion, and saute until tender, about 5 minutes.
Combine eggs, corn muffin mix, green chiles, whole corn, and creamed corn in a large bowl with the onion mixture.
Stir together and pour into the prepared baking pan.
Drop sour cream by the spoonful on top of the mixture; cover with Cheddar cheese.
Bake in the preheated oven until casserole is firm, about 45 minutes.
