A woman accused of stalking Chicago Cubs president Theo Epstein has a history of mental illness and can return to Boston for treatment while her case is pending, a Cook County judge ruled Monday.

Kathleen Kearney, 44, of Canton, Mass., told police last week she had been watching Epstein’s Lakeview home and was going to drop by to invite him to church. Officers took Kearney to Epstein’s home, where he identified her.

The Harvard-educated former librarian was freed from Cook County Jail on Friday after her brother-in-law posted her $7,500 cash bond.

Kearney faces two felony counts of stalking.