The Fairmount commuter rail line will be free for two weeks, starting Monday.

The fare-free period, through Friday, May 21, is an attempt by the MBTA to build ridership on the line that runs entirely through Boston, from Hyde Park to the Financial District, with stops in Mattapan, Roxbury and Dorchester.

"We recognize it takes time for people to adjust their commuting habits," said Brian Shortsleeve, the T's acting general manager, "but we hope through a pilot that people who might be riding the bus or taking the Orange Line might try the commuter rail for a straight-shot 30 minutes into town, and if they start to use it, hopefully they will adopt a new way to get to work."

U.S. Rep. Michael Capuano, whose district includes the Fairmount area, is donating $53,000 of his campaign funds to pay for the program.

The Democrat says increasing ridership is key to improving service and reliability on the line. He says he believes that Keolis, the operator of the commuter rail, is committed to providing reliable service after it had been criticized for taking trains off the rail to serve other lines.

"When you don't have consistency, you cannot build ridership," Capuano told Radio Boston Monday. "So this is an attempt to try to get people to accept that the Fairmount Line has a new way to do business, it is more reliable, and it is a good alternative to driving or taking the bus."

After The Boston Globe reported in October that Keolis was canceling trains on the Fairmount Line more frequently than any other line, Capuano called for an investigation into whether the company was violating riders' civil rights. The Globe reports those cancellations then dropped.

"Once I learned the Fairmount Line had been subject to what I considered discriminatory treatment in a negative way, first we had to get that cleaned up," Capuano said in the Radio Boston interview. "And it's been cleaned up to my understanding, they no longer get treated that way."

The Fairmount Line is the only commuter rail line that operates completely within Boston. Seven of the line's eight stations are in so-called Zone 1A, which means a one-way fare normally costs $2.25 — the same as a subway ride using a CharlieCard. A ninth station, at Blue Hill Avenue, is expected to open in 2019.

With reporting from WBUR's Abby Elizabeth Conway and Newscast Unit