MLB manager to leave team after 18 years