New York City’s original huddled masses, oysters, teemed along the shoreline centuries ago. By some estimates, up through the 1600s every other oyster in the world lived in New York Harbor, according to Mark Kurlansky, author of “The Big Oyster.” Such abundance wouldn’t last.

Dutch colonists gave way to oyster stands and then over-harvesting, with polluted waters delivering the coup de grace to the last of New York’s oyster beds in the 1920s. On Tuesday, the New York mayor’s office called the oyster “functionally extinct.”

But, with the tenacity of an Andrew Lloyd Webber musical, the oyster refuses to die off. Though the harbor remains haunted by ghosts of pollutants past, the 1972 Clean Water Act lead to much cleaner waterways, plastic debris aside. By 2014, in some of the densest seabeds, the oyster count was as high as nine animals per square meter. On Tuesday, the New York Department of Environmental Protection and Mayor Bill de Blasio jointly announced the largest oyster installation of its kind.

All told, the project will use the porcelain from 5,000 old toilets, 50,000 living shellfish and a $1 million grant. When combined with old clam and oyster shells, the chunks of toilet porcelain — remnants from the city’s public school bathrooms — deposited at Jamaica Bay will act as anchor points for the new mollusk residents.

“This oyster bed will serve multiple purposes — protecting our wetlands from erosion, naturally filtering our water and providing a home for our sea dwellers are just a few,” De Blasio said in a news release. Thirty-six thousand adult and baby mollusks — called spat-on-shell oysters because they stick to their elders’ outsides — have already been deposited in 85 floating cages along the bay.

After the adults spawn, the marine biologists in charge of the installation predict the offspring will trickle down to the artificial bed and take root. As these animals feed, they filter pollutants out of the water, making the oyster reef more attractive to native oysters and other sea creatures.

Land-dwelling New Yorkers might end up thanking the oysters, too. It’s not because the bivalves are destined to end up in oyster stands, but because the jagged rows of animals can absorb the shock of incoming waves, cutting the energy of storm surges by up to half.

Over the next two years, conservationists will monitor the pH, salinity and other properties of the new oyster bed. According to the Billion Oyster Project, a partner program for the new reef, New York now boasts 19 million restored oysters. When the last of the floating cages is deposited in the coming weeks, New York will be 50,000 oysters closer to that 10-digit goal.