Two terrorists machine-gunned Paris' best known Jewish restaurant today, killing six persons and wounding 21 in the bloodiest anti-Semitic attack in France since World War II.

French officials and the Palestine Liberation Organization deplored the attack. The Israeli government, in a statement, said the attack was the result of "the anti-Israel atmosphere in France, particularly in the French media," since the Israeli invasion of Lebanon, and said the atmosphere "encourages radical elements to attack Israelis and Jews."

An obscure French anarchist group called Direct Action claimed responsibility for the attack in a telephone call to the newspaper France-Soir, but police said they had no firm lead linking the attack to any political group. Direct Action was tied to small bomb explosions at two Paris businesses with Jewish connections during the weekend.

President Francois Mitterrand attended a memorial service Monday night at a synagogue in the traditional Jewish neighborhood where the shooting attack occurred. Earlier, Prime Minister Pierre Mauroy visited the scene.

Two gunmen apparently posing as lunchtime customers entered Jo Goldenberg's restaurant on Rue des Rosiers in the heart of the Jewish Quarter and sprayed the staff and customers with automatic weapons, witnesses said. The two men then backed out the door still firing and turned the guns on a group of people in front of a nearby synagogue, the witnesses said.

They escaped by walking slowly down the narrow Rue des Rosiers behind a white car driven by an accomplice, methodically scanning windows and doorways and firing at anyone who moved, according to neighbors who saw the shooting from their windows.

Eyewitnesses described the gunmen as slightly built men with dark hair in their twenties. In the confusion, Marko Goldenberg, son of the restaurant owner, fired a shotgun, seriously wounding a plainclothes policeman he mistook for a terrorist, French radio said. The policeman was on guard duty nearby because of threats against the restaurant.

Three women and three men were killed in the attack, Agence France-Presse reported. The attackers used machine pistols and threw a grenade through a restaurant window, AFP said.

Restaurant owner Jo Goldenberg had received a telephone death threat one hour before the attack by someone who said, "Palestine will win," AFP said.

Identities and nationalities of the victims were not immediately available.

Police arrived in force at the scene within minutes, but found no immediate trace of the car or gunmen. They cordoned off the area to search for bombs. Residents said rescue workers erected makeshift tents on the sidewalks to tend to those too badly wounded to be moved immediately. According to later reports, several of the wounded had legs amputated, apparently from wounds caused by a grenade explosion.

The street was littered with blood-stained debris in front of the restaurant, which has a sign with the star of David. Cars along the street were punctured with bullet holes.

The Rue des Rosiers is the main artery of the heavily Jewish Marais Quarter, whose 18th century buildings and numerous shops have been in vogue with Parisians in recent years.

When Mitterrand appeared at the synagogue service tonight, several hundred demonstrators chanted "Mitterrand is a traitor" in apparent reference to Mitterrand's recent criticisms of the Lebanese invasion.

Mitterrand is at odds with the Israeli government over the Palestinian issue, but his personal sympathy for Israel is well-known, and he benefited from French Jewish support in his presidential campaign last year.

His government has faced domestic criticism, however, over the mounting number of terrorist incidents in France, many linked to the Arab-Israeli conflict.

The worst postwar anti-Semitic terrorist act until now occurred in October 1980, when a bomb outside a synagogue in the Rue Copernic killed four persons and wounded nine, all passers-by. No arrests have been made in that case.

In April, an Israeli diplomat, Yacov Barsimantov, was assassinated in Paris.

Terrorists also have attacked PLO and Arab targets here. The deputy director of the PLO office in Paris, Fadel Dani, was killed July 23 by a bomb thrown into his car. A bomb explosion outside the offices of the pro-Iraqi newspaper Al Watan Al Arabi in April killed a pregnant woman and wounded 60 passers-by.

A U.S. diplomat here was murdered and another escaped a gun attack unharmed last year. Both attacks were claimed by a previously unknown Beirut-based group.

Direct Action claimed responsibility last June for placing a bomb--later defused--at the American school in Paris on the eve of President Reagan's visit to the city.