"After a competitive ... process, Freddie Mac retained McKinsey to conduct a gap assessment of our capital management capabilities and develop a roadmap to address any issues. This four-month engagement will begin in December," said a Freddie Mac spokesman in a statement to Reuters.

McKinsey did not respond to requests for comment.

Hiring McKinsey is the strongest signal yet that Freddie is beginning to draw-up a long-term roadmap to overhaul its operations and raise capital as a precursor to eventually freeing itself from government conservatorship.

Freddie and its fellow government-sponsored enterprise Fannie Mae were bailed out in 2008 during the subprime mortgage crisis. While the pair have not yet gotten approval to raise outside capital, they have been urged by their regulator, the Federal Housing Finance Agency, to shore up their operations to ensure they can function as standalone companies.

The pair, which guarantee over half of the nation's mortgages, are expected to eventually hire advisers to help them try and raise billions of dollars to rebuild their reserves, said Mark Calabria, director of the FHFA.

He also has emphasized that the two companies need billions of dollars in additional capital before they can safely be set loose, to ensure any downturn in the housing market does not lead to their failures.

Fannie Mae did not respond to a request for comment.

The FHFA is seeking its own outside adviser to build a "roadmap" for recapitalizing the firms, and hopes to announce the pick by the end of November. Calabria has said he expects the FHFA to hire its adviser before Fannie and Freddie hire their own for any capital raise so as to avoid any conflicts of interest.

In addition, the FHFA is working on a rule establishing new capital standards for them. Calabria expects to announce in the coming weeks if the FHFA will need to re-propose that capital rule, which he has said must be finished before the companies can begin raising funds, potentially through public stock offerings.

The pair were only recently permitted to begin rebuilding their reserves, with the FHFA announcing in September they could retain up to $45 billion in earnings.

The Trump administration has vowed to end the long-standing government lifeline, with the Treasury Department offering in September a set of recommendations for returning the pair to their standing as private companies.

(Reporting by Michelle Price and Pete Schroeder, Editing by Franklin Paul, Jonathan Oatis and Diane Craft)

By Michelle Price and Pete Schroeder