I woul like to quote a hadith:

Imam Ja'far Sadiq (a.s.) narrates from his father that the Prophet (s.a.w.s.) has made Congregation Prayer compulsory for those living in the neighborhood of a mosque and used to say, "Those who do not pray in congregation will not succeed in their business. I will order the muezzin to give prayer-call and order a personality from my Ahle Bayt, that is Ali, to take a torch in his hand and burn the houses of those who do not pray in congregation."

Iqbal al-A`amal, page 293

My question is simple: why is the Prophet being so violent while he is supposed to be a mercy for the universes?

This was a threat to hypocrites who would secretly gather to destroy Islam and uproot the Muslim community. So it was an issue of security. Hypocrites would try to skip Salat and then strategize to put an end to Islam, so the Prophet (s) warned them.