Nine months after he took office, Mayor Martin J. Walsh faced a calamity: He had to evict hundreds of people from a homeless shelter and several addiction treatment programs on a harbor island, after the city abruptly condemned the rickety bridge to the mainland.

A crisis like the one in October 2014 would dismay any politician. But Walsh, openly in recovery from alcoholism, had been seen as a beacon for others who have struggled with addiction. Now here he was rousting 225 people from their treatment programs.

Three years later, Walsh’s handling of the closure of Long Island hangs over any discussion of his response to the opioid epidemic.

The city and state worked with private agencies to replace the island’s treatment facilities. But some of the treatment beds ended up in Stoughton, and it’s not known how many people dropped out of treatment during the time it took to restore the beds.

Officials with two programs once located on Long Island praised Walsh’s efforts to make them whole again.

“The mayor absolutely came through. He has my full support and endorsement,’’ said Jonathan Scott, president and CEO of Victory Programs, which ran a women’s treatment program on Long Island.

But others blame Walsh for the crowds of people, clearly in the throes of addiction, who have become an increasingly visible and troubling site near the intersection of Melnea Cass Boulevard and Massachusetts Avenue.

Less visible, they say, is the mayor himself.

Jack Kelly, an advocate and the founder of a smartphone app that connects people in recovery, faults the mayor for not appointing a high-profile go-to person to address addiction. The Long Island closure, while not the mayor’s fault, “was not the time for a sort of quiet bureaucratic response,’’ Kelly said.

“I can’t identify anyone anywhere that is in charge of this,’’ he said.

Kris Perry Long, who runs a Facebook support group for people struggling with addiction, said that she has not seen the mayor at grass-roots community events surrounding recovery. “I have never seen Marty Walsh,’’ she said. “He needs to get down in the trenches and he needs to show his face and take his suit and tie off.’’

The opioid overdose crisis deepened just as Walsh took office. In 2012, state health records show, 70 people died of opioid overdoses in Boston. By last year, that number had increased to 202.

Statewide data suggest a slight drop in opioid-related deaths in the first half of this year, and incomplete data from Boston hint that the city has seen a similar trend.

Walsh, who faces City Councilor Tito Jackson in the Nov. 7 election, said he’s taken numerous steps to address the epidemic, and ticked them off in an interview last week.

He established the Mayor’s Office of Recovery Services, hired four new outreach workers to and connect addicted people on the street with services, and made sure police and firefighters were trained to administer the overdose-reversing drug naloxone.

Walsh bolstered resources for the team that collects discarded needles, expanded the hours of a city program that connects people to treatment, and added addiction-treatment referrals to the tasks handled by the city’s 311 information line.

“I’m trying to create as many opportunities as I can to get people into recovery,’’ Walsh said, adding that those efforts encompass not just the highly noticeable people on Melnea Cass, but families throughout the city far from public view.

He called it unfair to focus on the Long Island closing.

“The opioid crisis has nothing to do with the closing of the Long Island bridge,’’ the mayor said. “We had an epidemic the day before we closed that bridge. We had an epidemic the day after. . . . We’ve replaced every bed. There’s nothing I could have done differently.’’

Victory Programs replaced 46 of its 47 Long Island beds at three Boston locations, including a 24-bed women’s program that opened in May, back by city and state funding.

“The fact that we did it in 2½ years was nothing short of a miracle,’’ Scott said.

Thomas L. Bierbaum, president and CEO of Volunteers of America Massachusetts, was also able to find new locations for the treatment programs his agency ran on Long Island.

He sees the loiterers in the Melnea Cass area from his office windows, some openly shooting up on the street. Although some people blame their presence on a loss of treatment programs previously offered on Long Island, Bierbaum said he doubts that’s true. More likely, he said, the opening of a homeless shelter on Southampton Street to replace the one on Long Island led to a higher concentration of needy people in the neighborhood.

Representative Nick Collins, whose district encompasses Long Island and other Boston neighborhoods, said he thinks Walsh has done what he could to cope with the epidemic.

“The mayor understands this issue probably better than any other mayor in the country,’’ Collins said. “No one can say the mayor hasn’t put his money where his mouth is.’’

State Representative Daniel J. Ryan, whose district includes Charlestown, agrees.

“It looks to me like, citywide, he’s putting the tools in place that we need,’’ Ryan said. “But it’s a growing epidemic that keeps changing on us.’’

But Kelly, the advocate and app creator, questions whether the mayor’s programs add up to much. Although Walsh created an Office of Recovery Services, Kelly hasn’t seen any impact.

“People ask me, what does that even do? The Office of Recovery. What do they even do?’’ Kelly said. “It doesn’t seem like anything’s changed.’’

Equally unimpressed is Jim Stewart, a founding member of the Boston Homeless Solidarity Committee. Such programs as the 311 line are meaningless when people still can’t get into treatment, he said.

“If there are no services for people to get to, it doesn’t matter how easy it is for them to access someone with a computer screen,’’ he said.

Dr. Jessie M. Gaeta, chief medical officer of the Boston Health Care for the Homeless Program, declined to comment on the mayor’s response to the Long Island closure. But she praisedhis other efforts.

“I really appreciate that Mayor Walsh has paid so much attention to, and increased resources for, people who are struggling with addiction,’’ she said.

She said she is also encouraged by a recent development: the opening, in August, of an “engagement center’’ link works behind the Southampton Street men’s shelter, an air-conditioned tent for people from the neighborhood with nowhere else to go during the day. The center provides computers, phones, coffee, water, snacks, television, books and magazines, and portable restrooms, as well as a nurse to manage routine health problems or refer people who need more care.

The center opened after conversations with residents, health care providers, and “people on the street,’’ said Devin Larkin, director of the Boston Public Health Commission’s Bureau of Recovery Services. “The common theme we got was people need a place to be during the day,’’ Larkin said.

The center, a six-month pilot, cost $200,000 to launch and monthly expenditures are projected to be $150,000. It has been almost full to its capacity of 100 people and just expanded its hours to 7 a.m. to 7 p.m., seven days a week, Larkin said.

Gaeta said she hopes the center will become an entry point to treatment.

But Stewart, of the Boston Homeless Solidarity Committee, said he sees no point in a “clubhouse’’ for people with such dire needs.

“It appears to me the tent was erected in order to have a place to herd people so the Newmarket business community won’t have to see them,’’ he said.

Walsh defends himself against such swipes with a trace of exasperation. He said he was criticized because people were on the street and is criticized for creating a place for them.

“Absolutely we want to get people out of sight,’’ he said. “We want to get them out of sight in a safe space, to try and use interventions to get folks into treatment.’’

In the end, Walsh said, government alone is not going to solve the age-old problem of addiction.

“Everyone is looking for that magic solution,’’ Walsh said. “It’s not a simple solution.’’

Felice J. Freyer can be reached at felice.freyer@globe.com.