Melanocyte-stimulating hormone has two functions in humans.
To defend the skin from the sun's UV (ultraviolet) rays, the body releases Melanocyte stimulating hormone, which stimulates the release of melanin, a chemical in the skin that causes people to have darker skin or when they "tan," which is the build-up of melanin in the skin.
To the best of the body's abilities, it aids in the prevention of skin cancer.
Melanocyte stimulating hormone's second purpose is to control appetite.