PHOENIX — When former Vice President Joseph R. Biden Jr. traveled to Senator John McCain’s Arizona ranch last Sunday to spend a few hours with his ailing friend, the two reminisced about the “crazy senators” they had served with, the overseas trips they took together for decades and the friendship Mr. McCain forged with Mr. Biden’s two sons.
But the conversation on the sun-splashed deck off Mr. McCain’s bedroom was not all nostalgia.
“Here John knows he’s in a very, very, very precarious situation, and yet he’s still concerned about the state of the country,” Mr. Biden said in an interview. “We talked about how our international reputation is being damaged and we talked about the need for people to stand up and speak out.”
As he battles brain cancer and the debilitating side effects of his aggressive treatment, Mr. McCain himself is reckoning with his history and the future, as he and a stream of friends share memories and say what needs to be said.
No one is saying goodbye, not explicitly. The son and grandson of admirals, Mr. McCain “doesn’t like overt sentimentality,” as his friend the former chief of staff Grant Woods put it. But his visitors are telling him they love him, how much he has meant to them — and together they are taking care of unfinished business.
The Republican senator encouraged the former Democratic vice president to “not walk away” from politics, as Mr. Biden put it before refusing to discuss a possible 2020 presidential run. Mr. McCain is using a new book and documentary to reveal his regret about not selecting former Senator Joseph I. Lieberman as his running mate in 2008. His intimates have informed the White House that their current plan for his funeral is for Vice President Mike Pence to attend the service to be held in Washington’s National Cathedral but not President Trump, with whom Mr. McCain has had a rockyrelationship.
And some of his associates, though not his family, have started to quietly put out word that they want a “McCain person” eventually appointed to fill his Senate seat, a roster that includes his wife, Cindy.
Mr. McCain, 81, is still in the fight, struggling with the grim diagnosis he received last summer: He has been leading conference calls with his staff in a strained voice, grinding out three-hour physical therapy sessions and rewarding himself most days with a tall glass of Absolut Elyx on ice.
But his health has become a matter of immediate political interest. Mr. McCain’s future may determine whether Republicans retain their single-seat Senate majority: Should the senator die or resign before the end of May, there will most likely be a special election for the seat this fall. But under Arizona law, if he remains in office into June, there will probably not be an election for the seat until 2020, which Republicans would prefer given Democratic enthusiasm this year.
The matter of succession for the McCain seat — a topic of such intense discussion that Republicans officials here joke that Washington lawyers know Arizona election law better than any lawyer in the state — is officially verboten among party officials and the senator’s friends. They are determined to reward him with the same good ending that his friend Senator Edward M. Kennedy enjoyed before he succumbed to brain cancer in 2009.
Mr. McCain, who is not doing interviews, delights in sitting out on his deck where he once handled slabs of ribs on the grill, friends say. He and his wife listen to the hummingbirds and the burbling stream that runs through their 15-acre ranch, enjoy the verdant scenery in an otherwise arid region and divide their loyalties when the hawks start pestering Peanut, their Chihuahua mix. (Mrs. McCain sides with their dog, Mr. McCain the hawks.)
“He finds real solace there,” Mr. Biden said.
A bout of diverticulitis temporarily landed him back in Phoenix’s Mayo Clinic last month. It caused him to miss seeing more than a hundred of his friends and colleagues, including the new secretary of state, Mike Pompeo, and Secretary of Defense Jim Mattis, who came to Arizona to attend the annual meeting of his foreign policy think tank, the McCain Institute.
Mr. Lieberman filled in for Mr. McCain at the forum and visited the senator afterward at the hospital, mixing talk of North Korea and Iran with well-worn jokes, like the one about the difference between a lawyer and a catfish. (One is a bottom-feeding scum-sucker; the other is a fish.)
“He was O.K., but he wanted to get out of the hospital,” recalled Mr. Lieberman, one of Mr. McCain’s closest friends. “Look, this is a man whose whole life has been active.”
Having spent over two years in solitary confinement while he was imprisoned in Vietnam, Mr. McCain has no use for being alone, whether it is in the intensive care unit or at his ranch. And his deck is where he receives a constant flow of friends — with visits that often end with Mr. McCain saying, “I love you” — and takes calls on the iPhone he just swapped for his tattered flip phone. (Mr. McCain finally made the switch to download the Major League Baseball app to better follow his Arizona Diamondbacks.)
Mr. Biden and his wife, Jill, were there last weekend; Senator Jeff Flake of Arizona, a Republican, and his wife, Cheryl, visited Friday; other colleagues are set to come this week and his seven children are there as often as they can. The phone calls have been even more frequent: Former President George W. Bush checked in last week, telling Mr. McCain the country is missing him.
In a visit on the deck earlier this year, Mr. Flake said he and Mr. McCain recalled how in the 1980s the legendary former Arizona congressman Morris Udall, a Democrat, had taken the newly elected Mr. McCain under his wing despite their differences in party.
“It was the two of us lamenting the loss of the politics of the past,” Mr. Flake said.
It was also at his Hidden Valley Ranch where the senator participated in a nearly two-hour HBO documentary and co-wrote what he acknowledges will be his last book, “The Restless Wave,” both of which are set to be released this month.
The film and the book, a copy of which The New York Times obtained independently of Mr. McCain, amount to the senator’s final say on his career and a concluding argument for a brand of pro-free trade and pro-immigration Republicanism that, along with his calls for preserving the American-led international order, have grown out of fashion under President Trump.
In the book, Mr. McCain scorns Mr. Trump’s seeming admiration for autocrats and disdain for refugees.
“He seems uninterested in the moral character of world leaders and their regimes,” he writes of the president. “The appearance of toughness or a reality show facsimile of toughness seems to matter more than any of our values. Flattery secures his friendship, criticism his enmity.”
Yet many in Mr. McCain’s own party believe that, by selecting Sarah Palin as his running mate in 2008, he bears at least a small measure of blame for unleashing the forces of grievance politics and nativism within the Republican Party.
While he continues to defend Ms. Palin’s performance, Mr. McCain uses the documentary and the book to unburden himself about not selecting Mr. Lieberman, a Democrat-turned-independent, as his running mate.
He recalls that his advisers warned him that picking a vice-presidential candidate who caucused with Democrats and supported abortion rights would divide Republicans and doom his chances.
“It was sound advice that I could reason for myself,” he writes. “But my gut told me to ignore it and I wish I had.”
Even more striking is how Mr. McCain expresses his sorrow in the documentary. He calls the decision not to pick Mr. Lieberman “another mistake that I made” in his political career, a self-indictment that includes his involvement in the Keating Five savings and loan scandal and his reluctance to speak out during his 2000 presidential bid about the Confederate battle flag flying above the South Carolina Capitol.
Mr. Lieberman said he didn’t know Mr. McCain felt that regret until he watched the film. “It touched me greatly,” he said.
Here in his adopted state, he has been immortalized as an icon. “John McCain is a giant in Arizona,” said Gov. Doug Ducey, a Republican, expressing sentiments that were echoed by the teachers protesting at the state Capitol last week.
Erik Gillman, a math instructor, said Mr. McCain had become the new Barry Goldwater, a figure as inextricably identified with the desert as cactus.
“It’s what people think about when they think about the state: the Grand Canyon and John McCain,” Mr. Gillman said.
But Mr. McCain’s conservative detractors have not forgiven his maverick tendencies simply because he is ill.
When Mr. Pence addressed a hard-right audience gathered in Tempe last week to promote the administration’s tax cuts, he said that “people all across America are praying for Senator John McCain” — and one woman yelled out, “to retire.”
Mr. McCain has long been both a flawed politician and a larger figure of history, by virtue of his refusal to be released early from Vietnamese captivity. Former Senator Robert J. Dole, for example, wore Mr. McCain’s P.O.W. bracelet while his future colleague was in the Hanoi Hilton prison camp.
Mr. Dole, now 94, said he planned to tell Mr. McCain in a coming phone call, “You’re a tough guy and you can overcome this.”
In Washington, Mr. McCain’s admirers believe the Senate and the Republican Party lack a needed counterbalance to Mr. Trump and worry that his absence only presages a larger decline in the country’s politics. With Mr. Kennedy gone and Mr. McCain ailing, Representative John Lewis of Georgia, the civil rights legend, is one of the few figures left in Washington who evoke a bigness at a moment in history that can seem all too small.
“The Senate is changing just like the country is changing,” said Senator Lindsey Graham, the South Carolina Republican, who is Mr. McCain’s closest friend in the chamber. “But Washington now reflects what’s going on in the country, rather than leading it.”
Another McCain protégée, Senator Amy Klobuchar of Minnesota, a Democrat, said she treasured how Mr. McCain treated her when they went on the congressional delegation trips he loves and foreign leaders would attempt to recognize the male lawmakers before her.
“They’d always look to Lindsey next,” Ms. Klobuchar said of the heads of state, referring to Mr. Graham, a frequent travel companion of Mr. McCain. “But he’d always say, ‘Senator Klobuchar is the Democratic lead and she’ll be going next.’”
Mr. McCain’s has been a lifetime of restlessness, beginning with the childhood relocations of his Navy family and evolving into unceasing demands of “what else?” aimed at his Senate staff. But the man whose political career took flight after he fended off charges of carpetbagging — by noting the longest he had lived in one place was as a prisoner of war — has found a measure of contentment on his ranch.
Mr. Biden said he was struck by how solicitous Mr. McCain was of him, inquiring about how he coped with the loss of his son Beau to brain cancer. Yet the former vice president said he was the one who hoped to impart a message.
“I wanted to let him know how much I love him and how much he matters to me and how much I admire his integrity and his courage,” Mr. Biden said.
Then he became more succinct. “I wanted to see my friend,” he said.
A version of this article appears in print on , on Page A1 of the New York edition with the headline: At Home, McCain Shares Memories and Regrets. Order Reprints | Today’s Paper | Subscribe