Many Massachusetts communities have right-to-farm bylaws.
Map of communities with bylaws
MA Agricultural Commissions
Find a partial list of communities and their bylaws here
Massachusetts model bylaw for communities
See link in righthand column here