Ray McGrath, a retired San Francisco Fire Department captain who stayed on as a toy drive volunteer and morale booster, sometimes walking from station to station throughout the city, has died at 95.

Mr. McGrath died Tuesday of injuries suffered in a fall at home while on his way to Mass last Sunday. His death was confirmed by Fire Chief Joanne Hayes-White, who went directly to San Francisco General Hospital when she heard Mr. McGrath had fallen. Already at his bedside were two nuns, a priest, and a hallway full of family members and old firefighters.

“Ray was a legend. Just a kind, compassionate Catholic man,” Hayes-White said. “He loved this city and knew the name of every street and alley.”

Though Mr. McGrath served the customary 30 years in the department, from 1947 to 1977, he was involved for another 40 years. Among the duties he adopted was as minister to injured firefighters and confidant to Hayes-White as she transitioned the department from its old-boy ways to a modern department integrated by race and gender.

In his retirement, Mr. McGrath walked 18 to 20 miles a day from his home in Daly City, up the coast, around to North Beach and back. When standing still, he worked in programs to feed and clothe the poor and in social justice causes. He was active in church sanctuary movements and even got himself arrested in Georgia, where he’d gone to defend the rights of refugees.

“He was always protesting something,” said his daughter Geraldine McGrath, a corporate attorney in San Francisco.

Raymond Stephen McGrath was born Sept. 2, 1921, in his parents’ home at 1515 Palou Ave., in the Bayview district, which was then known as Butchertown, with cattle running up Third Street to the slaughterhouses. It was a mix of Irish, French, Italian, Portuguese and Maltese, and everybody had a nickname. His was “Jiggy,” the sixth of eight kids raised in a home with one bedroom, a parlor room for Mr. McGrath’s two sisters, and a back porch where the six boys slept.

“He used to say, ‘It was cold enough to hang meat back there,” Geraldine said. But it was the Great Depression and the McGrath family had no meat to hang. Mr. McGrath and his older brother Joe were sent to wait in the food lines captured by photographer Dorothea Lange.

“These were the things he remembered when he was serving the poor,” Geraldine said.

Three of his older brothers, Joe, Art and John, had been star football players at Sacred Heart High School, but Mr. McGrath was too small to play sports. He never liked academics and intentionally flunked out of Sacred Heart as a sophomore.

He was forcibly returned to Mission High School, from which he graduated in 1939 and became a steamfitter.

With the onset of World War II, Mr. McGrath joined the U.S. Navy and served in the Pacific theater. While away at war, he sent a photo of himself in his Navy uniform to his friend Lorraine Kerrigan, who lived one block away. Her younger sister, Barbara, known as Bobbie, saw the picture and pledged to marry him, which she did, in 1948 at All Hallows, their childhood parish.

By then, Mr. McGrath had joined the Fire Department. His file lists him as 5 feet 9 and 160 pounds, but that may have been generous. When he strove to advance from fireman to truckman, he was too short for the 5-foot-9 minimum height.

To reach it, Mr. McGrath would lie on the floor at night while his daughter held his arms and his wife pulled on his legs, to stretch him. In combination with lifts in his socks, it worked well enough for him to qualify.

Back then, firefighters traditionally stayed in one station their entire career, but Mr. McGrath transferred around, always looking for the station with the most action.

“He was a great storyteller and loved history,” Hayes-White said. “The city was literally burning in the ’40s, ’50s and ’60s.”

In the mid-1960s, Mr. McGrath moved his wife and three daughters from the Bayview to a split-level ranch house in the Westlake district of Daly City.

Bobbie McGrath died in 1987 and was buried in Colma. Mr. McGrath later learned that there was space available for the two of them in the San Francisco National Cemetery in the Presidio, so he had his wife disinterred and moved to a plot near the flagpole with a view of the Golden Gate.

Once she was moved, Mr. McGrath would walk from home to visit his wife’s grave, often in the company of Al McCarthy, another retired firefighter. They’d follow the shoreline all the way around to the fireboat station.

According to Hayes-White, he liked to quiz firefighters on their knowledge of the streets, and he liked to visit firefighters injured in the line of duty.

One such firefighter is Melanie Stapper, who suffered major burns and lost most of her vision in a fatal Diamond Heights home fire in 1995. Already 20 years retired, Mr. McGrath had never met Stapper. But he took it upon himself to visit her at the hospital every day and sit at her bedside.

“He was truly here when others weren’t,” Stapper said. Once she was released from the hospital, Mr. McCarthy would regularly drive up to visit her at her home near the Russian River.

“She was a fallen comrade,” Geraldine said. “He was loyal to the Fire Department until the day he died.”

Survivors include daughters Geraldine McGrath of Hayward, Nancy Klein of Montara, and Deborah McGrath of Oakland, six grandchildren and nine great-grandchildren.

A visitation and rosary will begin at 5 p.m. Friday at St. Teresa of Avila. A Fire Department color guard, honor guard and engine will attend his funeral Mass at 10 a.m. Saturday, all at St. Teresa, 1490 19th St., San Francisco. Donations in his name may be made to the St. Vincent de Paul Society at St. Teresa of Avila.

Sam Whiting is a San Francisco Chronicle staff writer. Email: Twitter: @SamWhitingSF Instagram: @sfchronicle_art