Administration officials scrambled last night to keep the Senate from limiting deployment of the MX to 40 missiles but managed only to delay until today the key vote on this centerpiece of President Reagan's strategic-arms program.

Sen. Sam Nunn (D-Ga.), sponsor of the amendment to limit the deployment to 40 and use any others for spares or testing, said after several meetings with administration officials that he sees no reason to back away from his proposal.

Senate vote-counters said Nunn has enough votes to add his amendment to the Senate's fiscal 1986 defense authorization bill. Backers of the amendment said 40 MXs would be enough to counter Soviet silo-busters without confronting the Soviet Union with a force large enough to wipe out its land-based offense in a first strike. Opponents counter that any such MX cap would weaken Reagan's negotiating hand at arms talks.

Limiting the Air Force to 40 MXs in Minuteman missile silos in Wyoming would give Reagan less than half of the 100 MXs he requested and a fraction of the 200 that Jimmy Carter proposed as president.

The MX cap has strong House support, prompting the White House to dispatch two heavyweights to Capitol Hill yesterday to make a last-ditch Senate fight for Reagan's MX program.

Former senator John G. Tower (R-Tex.), who was chairman of the Senate Armed Services Committee and is one of the president's arms-control negotiators at Geneva, and national security affaiirs adviser Robert C. McFarlane met with several senators in hopes of defeating or modifying the Nunn amendment.

One administration proposal rejected by Nunn and his allies was to "pause" after deployment of 50 missiles but not use the word "cap," according to Senate sources.

Nunn, after one of several meetings with Tower and McFarlane, said Reagan "has stuck rigidly" to planning for 100 MXs in silos now filled with smaller Minuteman missiles "and asked everyone else to compromise. The president is still stuck on a 1980 campaign pledge."

During his first presidential campaign, Reagan ridiculed Carter's proposal to rotate 200 MX missiles among 4,600 concrete garages spread around valleys in Nevada and Utah to make the missiles difficult to hit. For the last four years, Reagan has tried to find a better home for the MX but encountered strong congressional and public opposition.

Reagan resorted to appointing a special commission. Headed by retired Air Force lieutenant general Brent Scowcroft, it recommended putting 100 MXs in existing Minuteman silos in Wyoming while developing a small, mobile missile known as Midgetman that would be hauled around military bases to make it hard for Soviet gunners to target.

While Tower and McFarlane were pleading with senators, the Air Force was circulating a paper to Senate and House members declaring that no fewer than 50 MX missiles should be deployed. The Air Force said a smaller force would pose significant technical difficulties.

The administration lobbying, together with an Air Force paper fighting for only half of the number of missiles Reagan originally requested, provided further indication that the White House sees the MX in a fight for survival.

Sen. Gary Hart (D-Colo.) said in an interview yesterday that the MX cap being pushed in Congress is the death knell for the missile.

"Deploying 40 MXs," he said, "makes even less sense than deploying 100. We are moving away from the MX incrementally. The vote for 40 is just a fig leaf to cover the movement away from the MX. The Scowcroft coalition has been shattered. I think we've won."

Hart made these remarks after his amendment to kill the MX was defeated, 56 to 42. He contended that the MX will eventually die of its own political weight.

Sen. Charles E. Grassley (R-Iowa), at the opposite end of the political spectrum from Hart, agreed that capping the MX would mean that the missile is virtually a lost cause politically. He said nothing that happens at the Geneva arms talks can save the MX and predicted that, only if the mobile Midgetman is delayed, will the MX be deployed in Minuteman silos.

Senate MX backers say the missile is needed to counter large, land-based Soviet missiles so numerous that the Soviets have the theoretical ability to wipe out all U.S. land-based missiles with a fraction of theirs.

Sen. Strom Thurmond (R-S.C.), who attended the meetings with administration officials, said Tower told Nunn and others that capping the MX "would be detrimental" to arms talks because it would "send the wrong kind of message" to the Soviets.

Even if the White House should persuade Nunn and his allies to raise the cap to 50, congressional sources said, the House is almost certain to vote to limit deployment to 40, setting the stage for a compromise at 45 if a House-Senate conference is needed on the bill.

In other developments, the Senate:

* Refused, 85 to 9, to reinstate the recommended $1.8 billion Armed Services Committee cut in the military retirement fund.

* Voted, 84 to 10, for a "sense of the Senate" resolution that a summit meeting between Reagan and Soviet leader Mikhail Gorbachev be held "at the earliest practical time."