Quest-based bonding with companions takes different forms. With Cait and Nick Valentine, you'll need high partner affinity before they will confide in you, thereby triggering their special quests. With MacCready, it's a more gradual process.
To find MacCready, head to the VIP room at The Third Rail in Goodneighbor. You can recruit him immediately, even though he's in the middle of a disagreement with two Gunners, Winlock and Barnes.
Take MacCready on your quests and adventures of choice, strengthening your bond along the way. If you need tips on how to speed up the process, consult our Companions Guide. Eventually, he'll confide in you about his unresolved issues with Winlock and Barnes.
Travel with him to the Mass Pike Interchange at the west side of The Commonwealth and invade the Gunners' stronghold at both ground level and on the highway. Kill Winlock and Barnes.
Continue travelling with MacCready. Assuming you continue to do things that please him, he'll eventually tell you about his sick son. Once that happens, travel to Med-Tek Research near Maiden Township in the north part of The Commonwealth.
Once inside the research building, take out a slew of Ghouls and address a containment alert. (MacCready will give you a piece of paper that will shut down the containment alarm.) Continue exploring the building until you reach a lab. In the center of the room is the antidote for MacCready's son. Grab it and then speak with MacCready.
Travel back to Goodneighbor and visit Daisy's Discounts to conclude the quest. Doing so will bring you very close to maximum affinity with MacCready, which will trigger his companion perk.
Check out our Fallout 4 companion guide to learn everything you need to know about your fellow travelers and their perks.