To get sole custody in Massachusetts, you can file with the court if you are going through a divorce or if the child was born out of wedlock. You must apply to the Massachusetts court system if you want sole custody. If the parents are not married, the parent must first establish paternity before filing for custody of their child. A judge can establish paternity if one parent requests paternity in court, or if both parents sign and file a voluntary recognition form, which the parent may have signed already when the child was born.
The parties can agree on custody and, if approved by the court, be part of the divorce decree. If the parties cannot agree, the court will resolve the matter at the final hearing. If you are not married, the mother has sole physical and legal custody of her child, even if there is no court order on custody.