The French Socialist Party is laying the groundwork for a claim, in case the left loses the coming legislative elections, that the government majority won a thin victory thanks to the clever and sometimes illegal manipulation of a special electoral law for French citizens abroad.

Social Party leader Francois Mitterrand has put the government on notice that, regardless of the outcome he will demand a formal parliamentary inquiry.

The brewing affair stems from the hasty passage on the last day of the National Assembly session last June of a law to make it easy for the 700,000 French voters living on foreign soil to vote. In the last parliamentary elections, only 45,000 French citizens in foreign jurisdictions voted.

The law, passed by a show of hands, provides the Frenchmen abroad could choose to vote in any French town of more than 30,000 inhabitants by sending their proxies to registered voters there. Proxy holders may cast as many as five extra votes each.

The Socialists now allege that the government was out to give itself an electoral edge by organizing the voters abroad into fires brigades to influence the outcome in close districts.

Prime Minister Raymond Barre issued a long response to a series of questions by Mitterand admitting most of the facts the opposition leader asked about but explaining them away as technical or inconsequential irregularities.

The use made of the law illustrates how closely divided the country is on district-by-district basis and how little it would take to produce a parliamentary majority with a minority of the voters carefully allocated in key districts.

The newspaper Le Monde gave the example of 273 votes from the island republic of Mauritius that were all registered in the city of Tours, where the pro-government candidate won by just 14 votes in the last elections.

But the limited attention that the French press and public have paid to the matter also seems to illustrate a resignation to questionable political practices.

Le Monde published a sort outraged commentary on the current alleged scandal, but it was printed with a very small headline at the bottom of an inside page where a regular reader of the paper would not normally expect to find it.

The Foreign Ministry waged an intensive information campaign among top diplomats abroad on how to get out the vote. Prime Minister Barre said that 160,000 voters had registered and sent their proxies to France.

Some government strategists are quietly predicting that the governmental parties will lose in the popular vote but manage to remain in power with a majority of about five assembly seats. A few hundred extra votes each in a number of close districts could turn the tide.

Packets of proxies reportedly flowed into town halls of key districts all over the country with the town's name often written in identical handwriting. Such packets of several hundred votes at a time often came in together from the same country.

In December, the French ambassador in Gabon, Maurice Delauney, sent the Foreign Ministry a cable - which was leaked and whose authenticity Barre has confirmed - that said a representative of the French community in Gabon was on his way to France with 1,650 requests to be registered with the names of the towns blank and a corresponding number of blank and proxy votes.

Two further "identical" packets were scheduled to be sent out later in the month, according to the telegram. Still another shipment would be sent out Jan. 1 "if necessary," the telegram concluded.

The telegram mentioned in passing that," as agreed with representatives of parties of the majority," the papers would be turned in at the headquarters of the Rally of Frenchmen Abroad - a group headed by Gaullist Foreign Minister Maurice Schumann and organized to support the government parties soon after passage of the new law.

An official inquiry by the Foreign Ministry cleared the ambassador to Gabon, who nevertheless was called hom for consultations, of any wrongdoing.

Five hundred of the Gabon votes showed up in a Paris district where Claude Estier, the Social Party spokesman and a close collaborator of Mitterand, is in a tight race. A court invalidated most of those, as well as 200 other votes from Gabon in a neighboring Paris district. Other courts, however, upheld the validity of 500 Gabon votes each in Toulouse and in the Dordogne region.

In Marseilles, 2,500 votes came in from the Ivory Coast and in Montpellier 1,500. In Auxerre, about 350 registrations from Mexico were invalidated.

The Socialists are appealing local court validations of 400 votes each from Madagascar that were registered in Brest and Troyes, where Defense Minister Robert Galley is running.

In most cases, the Socialists have been losing their court challenges. But a cursory addition of the invalidated registrations and proxies to date shows that they number rather more than the 2,000 which Barre's statement said were involved.

Barre said that 20 embassies and consulates in such widely separated countries as Thailand, Switzerland, Lebanon, Senegal, Djibouti, India and Brazil had been asked to investigate themselves and had all replied that they found no irregularities.

A letter from Schumann's group to Frenchmen in Senegal called on voters there to choose districts "that need you the most," citing a district in Nice where the Communists had won by 505 votes the last time. It said that the group would give the voters in the names of their proxy holders in France later on.

In the Ivory Coast, a flier advised voters to leave the name of the town black, adding, "we will fill it in ourselves later in the interest of the majoriy that you are defending."

An information bulleting distributed in Thailand named two government candidates who were soliciting French voters abroad.

Top Socialist leaders admit that there was nothing strictly illegal about government parties putting one over on the opposition with the passage of a law that they then moved to exploit. What was illegal, the Socialists allege, was the use of official personnel and offices to facilitate the work of Schumman's political organization.