President Reagan said yesterday that all five members of the Joint Chiefs of Staff had agreed to put aside their reservations and support the "Dense Pack" basing plan for the MX missile "if this was the method I chose."

Both Reagan and Defense Secretary Caspar W. Weinberger tried to put a better face on the disagreement in the nation's highest military ranks over the MX deployment scheme, as the administration sought to have the Senate restore MX production money cut Tuesday by the House from this year's defense appropriations bill. But neither Reagan nor Weinberger denied that the military chiefs had been divided.

Army Gen. John W. Vessey Jr., chairman of the Joint Chiefs, revealed at the Senate Armed Services Committee on Wednesday that only he and Air Force Chief Charles A. Gabriel had recommended unequivocally to Reagan that he deploy the 100 MX intercontinental nuclear missiles close together in the Dense Pack formation outside Warren Air Force Base near Cheyenne, Wyo.

Weinberger, in a telephone interview with The Washington Post yesterday, disclosed that Army Chief E.C. Meyer and Navy Chief James D. Watkins favored putting MX missiles in existing Minuteman missile silos, while Commandant Robert H. Barrow of the Marine Corps wanted "to think about it some more."

Watkins first "thought submarines would be a good place for the MX," Weinberger added, "but I said we already had missiles in submarines."

Because Congress had forbidden the Pentagon to put the MX missiles in Minuteman silos, as Reagan has originally recommended, and had given the president a Dec. 1 deadline for choosing an alternative basing scheme, Weinberger continued, Dense Pack "was the only option open to us."

As a result, Weinberger said, it was his responsibility as the civilian head of the Defense Department to recommend Dense Pack to the president despite the reservations of the military chiefs. The complexities of the basing schemes made the chiefs' doubts "understandable," he added, "but all five said they would support the president's decision."

When asked by reporters at the White House yesterday how he could request the Senate to support an MX basing scheme that a majority of the Joint Chiefs had opposed, Reagan replied:

"I think that has been a little distorted because the same Joint Chiefs -- well, one or two at the most -- had different ideas that they thought might be better with all the confusing things. They did agree that if this was the method I chose, they would be in support of it."

Reagan made a rare, unannounced appearance in the White House press room at noon to make a statement on farm policy and answer this one question from correspondent Chris Wallace of NBC television. Wallace later reported that Reagan called him afterward to emphasize that the Joint Chiefs were in agreement with his Dense Pack decision.

Congress historically has been reluctant to approve military programs opposed by the Joint Chiefs. Past administrations have gone to great lengths to get them aboard before going to Congress with requests as significant as the MX, the 10-warhead intercontinental ballistic missile that Reagan has said is vital for closing the existing "window of vulnerability" and for convincing the Soviets that now is the time to agree to mutual arms reductions.

He sounded that theme anew last night, telling the Republican senatorial dinner that "the defeat of the Peacekeeper" -- Reagan's name for the MX -- "is the wrong message at the wrong time to the new Soviet leadership.

"First and foremost," he continued, "none of us should forget that the security of America is our highest responsibility. Just as our economic needs were neglected during the last decade, so too were our defense requirements. That is especially true in the area of strategic weapons.

"Now I won't take this opportunity to twist any arms," Reagan said, "but I must tell you now, when we can look each other in the eye, the MX system is needed. If we expect the Soviets to take our arms control proposals seriously, we must act seriously with the choices we make."

"Window of vulnerability" means that the Soviets have warheads that can destroy the existing U.S. force of 1,000 Minuteman land-based missiles. The idea behind Dense Pack is to bunch the new MX missiles so closely that attacking Soviet warheads would knock each other out of action as they exploded over the concrete silos enclosing the MX missiles.

Both White House spokesman Larry Speakes and Pentagon spokesman Henry E. Catto Jr. in separate news briefings yesterday reinforced the positive interpretation Reagan put on the Joint Chiefs' dissent on Dense Pack during his visit to the White House press room.

The chiefs "were unanimous in their recognition of the need and in their support for the missile," Speakes said. He added that Reagan probably would follow up last night's speech with an appeal for the MX funds in his radio address Saturday.

"I would not reach the conclusion that this split among the Joint Chiefs will kill Dense Pack," Catto said at his Pentagon briefing. "We're going to make a major effort" in the Senate to get back in the fiscal 1983 defense appropriations bill the $988 million in MX production funds deleted by the House on Tuesday on a 245-to-176 vote.