The 34-year-old Agassi said on Monday that McEnroe had told him he would not necessarily have to commit to playing every tie this year for the Americans, who have not won the Davis Cup since 1995.
Agassi will now join world number three Andy Roddick and the doubles team of Bob and Mike Bryan in taking on Croatia in a first-round match at Carson, California from March 4 to 6.
"Over the last few weeks, I have had several conversations with McEnroe and all the members of the Davis Cup team," said Agassi. "As a result of those discussions, and their unwavering support, I have decided to play Davis Cup in 2005.
"The captain and players know that my life will not allow me to play every tie at this stage of my career. Still, they all expressed encouragement which is very much appreciated.
"I look forward to joining the team."
Before McEnroe travelled to Agassi's Las Vegas home for a meeting last week, the veteran American had expressed doubts about the possibility of making a Davis Cup comeback.
AGASSI DILEMMA
"Andre was having a dilemma about committing to play every single match, something that he always felt was extremely important when it came to Davis Cup, and the reality was that it was going to be very difficult for him to do that," McEnroe said.
"I told him, 'listen, I'm not asking you to do that, nor are any of the guys on the team, nor does anybody expect that you're going to do that'.
"I said to Andre, 'don't cut off your options by saying it's all or nothing, because to me it's not'," McEnroe added.
"We've never had a year when we've had the same four guys every match. It's too unrealistic for that to happen, with injuries, with different surfaces, with schedules."
Agassi, who has a 30-5 record in the Davis Cup, stopped playing for the U.S. in 2000 mainly because he wanted to concentrate on the grand slams.
The eight-times grand slam champion begins his campaign in the San Jose ATP Open here against fellow countryman Bobby Reynolds on Tuesday night.