The setting: a remote pre-industrial port city.
The basic premise: As long as anyone can remember, the residents of the city have exhibited magical powers. The city had become fairly large as increasing numbers of merchants and travelers settled there and began to acquire the same magical abilities themselves. The source of the magic wasn't generally known, but nevertheless it provided the residents of the city a prosperous and fulfilling life.
Then one day the magic suddenly vanishes. Generations have passed without a memory of life before magic, and the society is completely unprepared to take care of itself without it. There is a little bit of violence and unrest, but mostly the citizens are paralyzed by helplessness and then hopelessness.
What kind of magical abilities make sense for this scenario? What is a plausible source of the magic, and how can it be restored?