Methylnaltrexone injection is used to treat constipation caused by opioid pain medications. Methylnaltrexone injection is in a class of medications called peripherally acting mu-opioid receptor antagonists. It works by protecting the bowel from the effects of opioid medications at receptor sites in the bowel. Methylnaltrexone injection comes as a solution to inject subcutaneously.