At the Camp David summit, President Carter urged his Cabinet members to "get close" to the members of the congressional committees handing his bill to restructure the civil service system, which he had just designated "top priority."

That lecture was not needed by one Cabinet-level aide, ambassador to the United Nations Andrew Young. Young had already made two visits in the last six months to the home district here of perhaps the most important legislator on the civil service question, Chairman Robert N.C. Nix (D-Pa.) of the House Post Office and Civil Service Committee.

Nix was well-aware of Young's presence, too, and that is just the problem: On both occasions, Young appeared with the Rev. William H. Gray III, who happens to be Nix's opponet in a hard-fought Democratic primary election on May 16. Two years ago, Nix beat Gray by 339 votes.

The first time he was there, Young spoke in Gray's church. The second time, just a few weeks ago, Gray introduced Young at a Jewish charity banquet, and the Rev. Martin Luther King Sr., who had spent the day campaigning with Gray, came along to be on the platform with them.

Young said through a spokesman yesterday that "neither appearance was political. I'm not involved in that race."

Nix said he was sure that was the case. "Perhaps they wanted to create the impression that he (Young) was endorsing him, but he didn't."

Still, it is not secret that members of the White House congressional liaison staff and national party officials were more than a little upset when they heard what was happening.

And since then, the administration has been working assiduosuly to make amends to the man who is studiedly neutral at this point on the subect of civil service reform.

Administration officials have mentioned to Nix, more than once, that Young and Gray are old friends from civil rights days and that the U.N. ambassador has operated independently of the White House in domestic politics on frequent occasions.

More pertinent, they are attempting to give Nix some tangible demostrations of his influence.

A Nix proposal that the Community Servces Administration finance a $100,000 "pilot project," hiring neighborhood residents to assist the Census Bureau in avoiding an undercount of minorities in the 1980 census, is "under very active consideration," a CSA official said. "There is an intention to proceed in the Philadelphia area," he said, and Nix expects to be able to make that announcement soon.

Similarly, the Economic Development Administration "hopes to have a decision shortly" on Nix's plea for a loan guarantee to reopen the Midvale steel forging plant, whose closing in 1976 cost 1,000 jobs.

When Nix visited with President Carter last Wednesday to discuss the prospects for the civil service bill, "he (Carter) said no endorsement would be made by Andrew Young," Nix declared. "I never mentioned it directly to him, but his representatives told me they were horrified at what had happened. What they did to assure it would not happen again I don't know but I have confidence in it."

The question of Young's role and the administration's attitude is not academic - either to Nix or to the ultimate fate of Carter's civil service reform.

Nix, whose age is generally believed to be greater than the 68 he officially claims, has been in the House for 20 years. He wa Philadelphia's first black congressman and all his life he has been a staunch ally of the city's Democratic organization.

But, as Nix observed, "there's a lack of discipline in the Democratic Party now," and in 1976, Gray, 37, organized a coalition of churchmen, reformers and a few breakaway labor leaders and almost upset the veteran chairman.

This time, forewarned, Nix is campaigning harder than ever, arguing that his power as chairman is "the best weapon for helping this district."

But Gray, who has received significant financial help from some of the city's biggest bankers and businessmen, said the North Philadelphia district, which includes some of the city's worst slums as well as some high-income areas, "needs visible, independent and aggressive leadership that will challenge the local leadership and won't play it safe."

Their battle has important ramifications for Philadelphia politics, for ex-Rep. William J. Green - son of the old Philadelphhia "boss" who launched Nix into politics - is backing Gray. Green is expected to run for mayor again next year when incumbent Frank Rizzo, who is backing Nix, says he will retire.

But there are also important implications for Carter and his civil service reform. Administration officials believe the plan has strong support in the Senate Governmental Affairs Committee, but are frankly worried about Nix's panel and the House.

Asked if the outcome of the primary would affect the legislatie preospects for civil service reform, Nix answered, with a slow smile, "The only adverse effect would be if I were defeated. It would be delayed and certain compromises that will be necessary would be much more difficult to effectuate."

Asked why that would be, he said, "Well, people will not show the same interest and dedication if they know the chairman will be replaced."

He hopes Andrew Young is listening.