Where you reside can affect whether or not the Court has jurisdiction over your case as discussed in a previous post: Where you get Divorced matters! - British woman loses rights to £1.2 Million Pension.
Assuming that Massachusetts has jurisdiction, you still need to disclose your address pursuant to Massachusetts Domestic Relations Procedure Rule 11 which states in pertinent part: "A party who is not represented by an attorney shall sign his pleadings and state his address, telephone number, and e-mail address if any." The Court needs to know your address so that the Judge can verify that jurisdiction is proper and in the event the court needs to send you Notice of any hearings or other matters. Likewise the opposing party needs your address in order to send you proper notice of pleadings pursuant to Massachusetts Domestic Relations Procedure Rule 5(b) and a P.O. Box is not considered sufficient.
It is possible to withhold your address from a party to a divorce case if you have reason to believe that disclosing your address will place you in danger. If this is the case, you must file any paperwork with the Court in person with a Motion to Impound Address and explain to the Judge why you need your address to be kept hidden from the other party. This is usually used in cases of domestic violence.