President Carter yesterday swore in John W. McGarry, a friend of and employe of House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.), as a member of the Federal Election Commission.

But the commissioner McGarry is to replace said he will go to court ot block the controversial appointment and won't give up his seat until the court settles the issue.

Commission member Neil Staebler, a former Michigan congressman, said he would seek a temporary restraining order against the president's action, because, under the election law setting up the FEC, no vacancy exists.

The law says a commissioner may serve after the expiration of his term until a successor has been nominated and confirmed by the Senate.

McGarry's nomination was submitted to Congress in 1977, but first became ensnarled in a dispute over a Republican FEC nominee and then about questions over the financial disclosure form McGarry had filed as counsel of the House Administration Committee.

McGarry's nomination was finally approved by the Senate Rules Committee, but the Senate adjourned without acting on it.

"The [FEC] act specifically requires that a member not only be appointed by the president, but must also be confirmed by the Senate," Stabler said. He added, "In attempting to circumvent the act by an interim appointment, the president's office does a great disservice to the cause of good government."

Staebler said that, until the court suit is acted upon, he will not give up his office and will continue to attend FEC meetings. "Until the restraining order is acted on, I will not attempt to vote, but I'll be sitting at the commission meetings." Staebler said he assumes McGarry would also attend the meetings.

Staebler may be joined in his suit by a citizens' lobbying group, Common Cause, which also criticized the president's action yesterday. Common Cause Vice President Fred Wertheimer said there were "very serious questions" raised about McGarry's qualifications, and added, "There is no excuse for the president's decision to short-circuit the constitutional process of advice and consent."

The White House argued that the president has a constitutional right to make appointments when Congress is in recess, that there is a vacancy on the FEC and that the Senate will have an opportunity to confirm McGarry when Congress convenes in January.

Asked if it was the White House's position that Staebler no longer had a job, White House press secretary Jody Powell said, "It is not only the position of the White House but the position of the Justice Department and has been the Justice Department's position since the 19th century."

Staebler said the White House was "quite clearly trying to find another route in for McGarry." A Common Cause spokesman called the White House action a power play to force Staebler out and get McGarry in and make the McGarry appointment an accomplished fact before the Senate had a chance to act.

The Federal Election Commission oversees the election campaign laws, campaign financing reports of presidential and congressional candidates and hears complaints about election law violations.