Leahy (pictured) was previously with Malahide Untied and St Kevin's Boys in Dublin.
The centre-back, who can also play at full-back, made his Ireland under-17 debut against Hungary in August 2014.
He won his first competitive cap against Gibraltar in the UEFA Under-17 Qualifying Round in September 2014 and was very impressive at the 2015 UEFA Under-17 Finals in Bulgaria.
Leahy, who was a mainstay of the Ireland under-19 side in the 2016/17 season, spent part of that season on loan at Nuneaton, making eight appearances.
Despite enduring a frustrating 2016/17 campaign, the-highly thought of McFarlane was rewarded with another year at the Blues in May.
McFarlane, who initially joined Birmingham as a 9-year old, impressed during pre-season and took his goalscoring form into the Autumn, notching 3 goals in four outings before a knee injury halted his progress.
He has returned to Boro for a second loan stint, having originally joined the club in January 2016.