The MTA plans to sue the city for the May blaze in East Harlem that damaged Metro-North train tracks and snarled train traffic for days.

In a “notice of claim” filed Wednesday, the state-run agency alleges that the massive fire that erupted in The Urban Garden Center on May 17 was due to the city’s “carelessness, negligence and recklessness.”

The Fire Department determined that the fire was caused by an accidental fuel spill. The garden shop had been storing quantities of gasoline and propane tanks without proper FDNY permits.

Following an FDNY investigation, the garden center was issued four summonses for unlawful storage, handling and use of liquefied petroleum gas (LPG); unlawful use of LPG for space heating; unlawful storage of gasoline in quantities requiring a permit; and unlawful storage of portable fueled equipment.

The MTA said in the claim the fire brought “substantial” damages to its infrastructure and a loss of revenue. Costs of the damages is still being determined.

During the ensuing weeks, the city and the Economic Development Corporation, which leased the property to the garden center, began regular safety sweeps its properties.

“The city has taken swift and strong action, and we’re doing all we can to prevent incidents like this from happening again,” the mayor’s office said at the time. “We are ramping up inspections in the affected area and reviewing sites under critical infrastructure citywide to ensure New Yorkers’ safety and peace of mind.”