President Reagan agreed with the Senate yesterday to accept 50 MX missiles, instead of the 100 he had sought, for deployment in existing Minuteman missile silos. The concession averted Senate action that could have halted deployment at 40.

"We are sending a clear signal to the White House that there will be no more MX missiles, no more period, until the White House and the Pentagon come up with a basing mode that is mobile and deceptive," Senate Minority Leader Robert C. Byrd (D-W.Va.) said in characterizing the agreement after four days of negotiations.

Reagan termed the plan "a bipartisan expression of continuing support for our strategic-modernization program." White House officials put a less favorable face on the MX limit, conceding that they failed to mobilize in time to defeat an amendment sponsored by Sen. Sam Nunn (D-Ga.).

The amendment to the fiscal 1986 defense authorization bill called for limiting MX deployment in existing Minuteman silos to 40 missiles and authorized production of no more than 12 missiles in fiscal 1986, rather than the 48 sought by Reagan.

The Senate's Republican majority kept the proposal from coming to a vote until the compromise was achieved, and the vote for passage last night was 78 to 20. Nunn said he compromised rather than be subjected to postponements, perhaps until June 3, when the Senate is to return from its holiday recess.

The action represented another setback for Reagan's proposed defense buildup, forcing him to restructure the centerpiece of his strategic-arms modernization effort.

"This is a nonpartisan sellout of the capabilities of the American people . . . these are not toys pointed at us," Sen. Malcolm Wallop (R-Wyo.) said, referring to Soviet missiles.

Forty-three Democrats and 35 Republicans, including all Maryland and Virginia senators, voted for the compromise. Four Democrats and 16 Republicans, including Wallop, opposed it.

Under the compromise, Reagan won deployment of 10 more missiles but had to settle for production of only 12 and a promise that the Senate will push for manufacture of another 12 to 21 missiles in fiscal 1987.

Congress has authorized production of 42 MXs, and the compromise would bring the total to 54, four of which and any others produced in the future would be used for spares and flight testing. Initial MX deployment in a Minuteman silo is scheduled for December 1986.

Nunn shied away from calling the compromise an outright victory for him and his Senate allies but said they obtained what they wanted most -- language approved by Reagan that limits to 50 the number of MXs destined for Minuteman silos in Wyoming.

"The language was more important than the number," Nunn said. The cap would be law for fiscal 1986 and nailed down for the long term under "sense of the Senate" language to be added to the authorization bill.

Reagan, Nunn added, has agreed to take a fresh look at other ways to base the MX. The Defense Department has said an MX in a Minuteman silo could be destroyed by the current arsenal of Soviet warheads.

National security affairs adviser Robert C. McFarlane, briefing reporters on the compromise, said the 50-missile cap could be considered "50 on the way to 100," the number sought by Reagan.

But Nunn was emphatic in saying that any above 50 would have to be deployed in a less vulnerable way.

"I don't think that there is any question that the president is making a substantial change in his MX program," Nunn said, adding that, under the president's promised new look at basing alternatives, finding a new home for the MX would be "possible" but not "probable."

Any future basing scheme for land missiles must include deception and mobility, Nunn said, features being built into the Soviets' new deployment programs.

Limiting deployment to 50, Nunn said, "eases the hair-trigger" on nuclear war.

If 100 missiles were deployed in such a vulnerable mode, he said, the temptation would be greater to launch them at the first warning of attack for fear they would be destroyed by incoming missiles.

Also, he said, having 100 MXs, with 10 warheads apiece, would make it more likely that the Soviets would launch land-based missiles on first warning as well.

Reagan, in his statement on the compromise, said, "The Senate has acknowledged the importance of this program for the Geneva negotiations as well as the requirement to deter an ever-expanding Soviet buildup.

"While I would prefer a more rapid procurement of Peacekeepers MXs , I applaud the Senate's agreement on the Peacekeeper issue. With this Senate action taken, it is now time for the House of Representatives to join this consensus."

The House is poised for a 40-missile cap when it begins debating its version of the Pentagon's fiscal 1986 procurement bill next month.

In 1981, Reagan recommended deploying a force of 200 MXs but kept changing his recommendation on how they should be deployed.

In 1983, he accepted the recommendation of a commission headed by retired Air Force lieutenant general Brent Scowcroft that called for deploying 100 MXs in Minuteman silos while seeking to build a smaller, more mobile missile known as Midgetman.

In the face of mounting congressional opposition to deploying as many as 100 missiles, Reagan and other administration officials have appeared resigned to a lesser number for some time.

In a separate development on the authorization bill, the Senate rejected on a 48-to-48 tie vote an amendment that would have reduced Pentagon authority to close military bases deemed unnecessary.

In the pending procurement bill, the Senate Armed Services Committee had provided greater Pentagon authority to close bases without prior congressional approval.