Keogh was left out of the Wolves side that defeated Southend United 2-1 on Tuesday night so he would be eligible to play for the Bluebirds in the same competition. He completed the move on Wednesday afternoon.
Keogh, 24, was linked with Doncaster Rovers earlier this season - where he would be reunited with former Iron strike partner Billy Sharp - but McCarthy said he was not willing to let the Republic of Ireland international go out on loan. He was also angered by public declarations of interest from the Keepmoat Stadium.
"Andy has been fabulous here both for me and this football club. It's a good move for him to go to Cardiff and good luck to him," said McCarthy.
"He wants to play football and doesn't want to be fourth in line here which I can fully understand. It was my decision to let him go but he goes with our best wishes and warmest regards."
Keogh moved to Glanford Park in 2005, signed from Leeds United for around £50,000.
His partnership with Sharp helped propel the Iron to the League One title in 2007/08, although he moved to Wolves in January. The deal was initially £600,000, with a further £250,000 if the Midlands club reached the Premier League - which they did.
He fell out of the first-team picture at Molineux last season, with an ankle injury ruling him out of three months of the campaign.
He will become the seventh signing of the season for Cardiff, who have already added Seyi Olofinjana, Danny Drinkwater, Jason Koumas, Lee Naylor, Tom Heaton and Craig Bellamy to their squad.