Amazon is still in the early stages of deciding whether it might bring a massive “second headquarters” to Boston. But the tech giant came to Dorchester Thursday with a big check.

The company said it will donate $1 million to St. Mary’s Center, a nonprofit in Upham’s Corner that provides housing, job training, and other services to homeless families. It’s the biggest gift ever received by the social service agency and comes ahead of its annual fund-raiser next week, which will be headlined by Boston Mayor Martin J. Walsh. Amazon said it will match donations up to $1 million.

The company has about 1,000 employees in Cambridge and Boston, and recently announced plans to add about 900 more at a new office in the Fort Point neighborhood.


To date, Amazon has kept a low profile in local philanthropic circles, but it has given to homeless-related charities in Washington, D.C., and Seattle and is building a family shelter at one of its new buildings in Seattle.

The gift also comes as Amazon is searching for a location to build a second headquarters, which would create approximately 50,000 jobs over 20 years. Cities nationwide are bidding for the project, and Boston is considered a strong contender. Walsh is leading Boston’s push, though he did not attend Thursday’s announcement. The mayor, who grew up in nearby Savin Hill, has close ties to St. Mary’s — he was born there, back when it housed St. Margaret’s Hospital.