Trincomalee, with one of the best natural harbors in the world, sits idle most of the time, used only by Sri Lanka's seven-ship Navy, a few pleasure yachts and drug smugglers.

Now the Trincomalee harbor, which served as headquarters for Great Britain's Far East fleet during World War II, slowly is coming back to life.

After a 12-year ban by the Sri Lankan government, warships from three nations have called there this year. The latest was the American destroyer, the USS Cushing, whose visit last month demonstrated the expanded U.S. naval presence in the Indian Ocean region.

While the small, somnolent town of Trincomalee is not the ideal liberty port for those sailors who want the traditional shore pleasures of cheap whisky and available women, the expanded Western and Soviet naval presence in the Indian Ocean makes it a real prize if for no other reason than to give sea-weary crews a chance to get off their ships.

Pentagon officials say one of the major problems with the increased U.S. naval presence in the Indian Ocean-Persian Gulf region is giving the sailors a chance to get some time off their ships.

There are a decreasing number of liberty ports in the area, with India generally considered off limits to U.S. naval vessels due in part to the delicate state of relations between Washington and New Delhi and Islamic Pakistan a difficult place for U.S. sailors to have any fun on shore leave. That leaves Singapore on the far eastern end of the patrol and the Kenyan port of Mombasa as the major drop-in spots for U.S. naval vessels.

Sri Lanka is almost perfect port of call for U.S. ships. The government of President J. R. Jayewardene is generally pro-American. The people are pleasant, the weather good. The country has beautiful beaches and plentiful cultural sights. The capital city of Colombo has good port facilities as well as some sailor recreation spots.

There have been published reports in India, many appearing in the pro-Soviet Communist Party daily newspaper The Patriot, that the United States is seeking a naval base either here or in Trincomalee from the Sri Lankan government.

Sri Lankan President Jayewardene declared that his country will not give a base to any foreign nation, and U.S. Ambassador Donald R. Toussaint characterized as a "myth" the report that the United States was seeking to turn Trincomalee into a base for its Indian Ocean fleet.

Instead, Sri Lanka appears to have evolved a new policy of letting any nation's warships use its facilities as long as the ship is not carrying nuclear weapons and the country is not at war.

As a result, about one American ship every two months calls at Sri Lanka. A greater number of Soviet ships call here and two Indian vessels arrived in Colombo recently.

So far only three foreign vessels -- one from Bangladesh, one from Australia and the USS Cushing -- have called at Trincomalee.

President Jayewardene explained that Sri Lanka reversed its longstanding policy against foreign ship visits there for one reason: money.

"We are a poor country and we can use all we can get, especially foreign exchange," he told the Far East Economic Review in a recent interview.

He said an Australian ship brought in about $320,000 in docking fees, purchases of supplies and money spent by sailors on shore leave.

Two American ships that called in Colombo in March -- the USS Fox and the USS Ranger -- were reported by the Sri Lanka Observer, a government-controlled newspaper, to have spent half a million dollars each during their stopovers.

Soviet ships, while more frequent callers here than Americans, are not known for free-spending sailors, most of whom appear to be restricted to their ships.

"I like American sailors. They come with lots of money," said a 13-year-old Sri Lankan boy patrolling outside a Colombo hotel with a string of necklaces over his arm. He calls all Americans "Charlie," and besides trying to sell necklaces, he also offers drugs and women. American officials here, highly conscious of the problem of drugs coming aboard ships, have sent two narcotics specialists from the Philippines to aid local authorities in keeping the narcotics traffic down.

Nonetheless, it is obvious that drug peddlers in this country -- which has become an important way station in the movement of narcotics from the Golden Triangle of Thailand, Laos and Burma to Western Europe and the United States -- are trying to cash in on the visits of naval ships.

Sri Lankan authorities reported that a 16-year-old boy had been set up in a hotel in Trincomalee to provide drugs to American sailors during the Cushing visit.

Sri Lankan customs officials believe that Trincomalee is increasingly being used as a place to bring narcotics into the country for transshipment to the West. Much of the narcotics is believed to come in on the few pleasure yachts that call there.

While the American sailors did not have much opportunity for wild times in Trincomalee, they did play volleyball against Sri Lankan naval cadets who have their school there and donated books and medical equipment to welfare organizations. In short, it was a perfect good-will visit as far as U.S. policy makers are concerned.

Many people here and in neighboring nations, especially India, fear that large numbers of foreign ship visits will turn Colombo and Trincomalae into classic sailor rest-and- recreation ports, with their rampant prostitution and open carousing.

But although Colombo has attracted sailors since the days of Sinbad, it never developed the reputation as a swinging liberty port.

"It's not a swinging kind of town. It's too subdued to be a good sailor port like Hong Kong or Singapore," said one Sri Lankan.

According to an apocryphal story going around here, one European embassy had a good deal of trouble finding a few respectable houses of prostitution here to recommend to sailors on one of its ships calling at Colombo.