When Hermann F. Eilts arrived here to prepare for the resumption of diplomatic relations between Egypt and the United States, the official American presence consisted of six people working under the flag of Spain in an American "interests section."

Now Eilts is retiring after five dramatic years as U.S. ambassador, and the embassy has a staff of about 190. It is still growing. Eilts said today that is too many, and warned that American interests in Egypt could be jeopardized by the relentless expansion that has involved Americans in Egypt's political, social, economic and now military affairs.

"All of us remember Iran," he said, "and while this is nothing like Iran, it could get out of hand. It's a mistake."

Eilts, who struggled in vain for five years to hold down the size of his staff-"I like to have a few people who will work overtime"-said he had made this point with Washington and hoped his successor, Alfred Atherton, would resist the desire of government agencies to send in "a lot of straphangers."

Eilts, 57, is a respected career diplomat noted for his devotion to hard work, attention to detail, crew cut and indifference to sartorial fashion. He has always been reluctant to be interviewed, but now that the Egyptian-Israeli peace treaty is in effect and he is moving on to a professorship at Boston University, he agreed to discuss his views of Egypt, the Palestinian autonomy negotiations and American policy in the region.

In a wide-ranging interview in his office, Eilts predicted that the forth-coming negotiations over the future of the West Bank and Gaza Strip would be "tough" and would yield little for many months. He acknowledged that the United States had failed to persuade "our Arab friends" in other countries to support the treaty. And he stressed his "worry" that the mushrooming American presence here could somehow backfire.

President Anwar Sadat, with whom Elits has worked closely during a tenure in which the United States has replaced the Soviet Union as the dominant outside influence on Egypt, is frequently accused by other Arab leaders of having become a tool of American policy in the Middle East.

The peace treaty has been attacked as an American-inspired document that undercuts Arab interests. Eilts said he was concerned that further growth of the American presence and influence here could make matters worse for both Egypt and the United States.

Eilts noted that the outcome of the Palestinian autonomy negotiations "at some point is going to depend on us" because "I have difficulty believing that the two parties themselves can work out the kind of mutually acceptable arrangements that each requires."

What worries him, he said, is "the flush of unthinking enthusiasm that exists in some quarters in the wake of the peace process and the belief that simply by the visibility of the numbers of people rather than the visibility of the actions themselves we can handle the situation.

"It's not the numbers themselves, it's producing on the basic issues of West Bank and Gaza autonomy and economic development; but I worry that everyone now wants to get into the act even if his contribution is a very marginal one and that can hurt us."

He did not specify which government agencies he was talking about-many of them, from the Air Force to the Central Intelligence Agency to the Department of Argiculture are already represented here-but he said the "biggest vulnerability" was in the Agency for International Development. AID is administering the billion-dollar-a-year assistance program and accounts for more than 100 of the 190 officials assigned to the embassy.

Eilts acknowledged that "you cannot run a billion-dollar program without the people to monitor it very closely." Yet what is important now for the United States, he said, is not to show the flag in Egypt but to devote its energies to helping Egypt and Israel make progress in the autonomy negotiations and restore good American relations with Arab critics of the treaty.

Relations with formerly friendly Arab countries such as Jordan, Saudi Arabia and Morocco, he said, are "not good. They want good relations with us and we with them. But I believe words will not be enough to allay their concern. I think we are going to have to demonstrate at the upcoming negotiations that what President Carter and the other members of his administration have said about the Palestinians is something we will do our very best to achieve. Unless we are able to achieve it, then I think these strains could last a long time."

Eilts, a former ambassador to Saudi Arabia who has spent most of his career in the Middle East, said he understood Arab criticism that the United States has not put into practice its own declared policies on the Palestinian question and the issue of Jewish settlements in the West Bank.

"Somehow," he said, "we haven't done a good selling job in putting across to our friends in the area that we really mean what we have said in terms of doing something for the Palestinians and bringing about a peace in the area that is a just and durable one for all parties. We will have to demonstrate it by our role in the negotiations."

At the same time, however, he said that some Arab countries are adhering to "maximalist" positions that have been fruitless for 30 years, without understanding the process of negotiation. "It's easy for those in the outer circle to kibitz," he said.

Eilts said that while the United States has filed to block Jewish settlement in the West Bank, it is "unfair to criticize simply because we don't take the kind of steps some of our Arab friends would like, such as cutting off economic or military aid. That simply is not feasible, nor even desirable."

In discussing his apprehensions about the autonomy negotiations and Arab criticism of the treaty, Eilts spoke quietly and dispassionately, as he always does. During his years in Cairo, he earned a reputation for unflappable self-control that served him well through extraordinary events - the collapse of disenagaement negotiations in March, 1975, the Sadat peace initiative, the Camp David summit.

He said he intends to recoun all those events in a book that will cover the evolution of U.S.-Egyptian relations during the years since President Nixon came here in 1974, near the end of his presidency, to restore friendship between the two countries. He hopes to include some still-secret details of those events, he said, because "otherwise it's not worth writing."