Elliot Lee Richardson, the Boston Brahmin with more fancy titles on his resume than any living politician, wants to be known as "Muggsy."

He adopted the nickname a week before announcing his candidacy for the U.S. Senate, when he showed up at the city's annual St. Patrick's Day celebration only to be kidded for having nothing but last names.

"Elyut," intoned Billy Bulger, president of the Massachusetts Senate, mimicking Richardson's upper-crust accent. "This is no ordinary mortal."

Bulger, a Democrat of Irish descent, held up a fake newspaper reading "Vote Elliot, He's Better Than You."

Richardson took the microphone.

"There are many things I admire about the Irish," he said. "Their warmth, their wit. What I particularly like are the names. The first names--Billy, Teddy, Sonny, Tip, Knocko . . . . I'd like to be known as Muggsy."

The polls show Richardson--his campaign buttons reading, "I love Muggsy"--leading a field of Republican and Democratic contenders with names such as Kerry, Shannon, Shamie and Connolly in this overwhelmingly Democratic and ethnic state.

The man who left here 15 years ago to become President Richard M. Nixon's undersecretary of state, secretary of health, education and welfare, secretary of defense and attorney general, who went on to be President Gerald R. Ford's secretary of commerce and ambassador to Britain, and who served President Jimmy Carter as negotiator for a sea-law treaty, has thrown the state into political ferment with his bold attempt at an electoral comeback.

The Massachusetts campaign, with keenly contested primaries in both parties Sept. 18, has become one of the most closely watched Senate races in the country since Sen. Paul E. Tsongas, a popular Democrat, announced in January that he had lymphoma, a form of cancer, and would quit to spend more time with his family.

Although no Republican has been elected to statewide office here since 1972 and GOP registration has dropped to 13 percent, Republicans nationally see the Bay State as one of their best chances to capture an open Senate seat. In the primary, Richardson, 63, faces Ray Shamie, 63, a spunky self-made millionaire who won a respectable 38 percent of the vote against Sen. Edward M. Kennedy (D-Mass.) in 1982.

The Democrats are sharply divided. Lt. Gov. John Kerry, former head of the Vietnam Veterans Against the War, and U.S. Rep. James Shannon, a savvy young liberal, lead a four-man field that includes a former speaker of the Massachusetts House, David Bartley, and Secretary of State Michael Connolly.

To many, the race seems an echo of Massachusetts political history.

Richardson's uncle and mentor, Henry Lee Shattuck, served on the Boston City Council as Mayor James Michael Curley's patrician scourge. Ethnic Democrats and Yankee Republicans have continued to square off since the heyday of the Cabots, Lodges and Saltonstalls: Edward M. Kennedy v. Josiah Spaulding; Michael S. Dukakis v. Francis W. Sargent.

"Beating Elliot is going to be tough," said Rep. Brian J. Donnelly (D-Mass.). "We have a tradition of voting for the old puritans. They have the image of integrity, of government service."

In recent years, the GOP has tried to recruit ethnics. Shamie, the son of working-class Syrian and French Catholics, is outraged by Richardson's sudden entry into the race.

"We reject the stereotype that . . . the Massachusetts Republican Party is merely a social club for the elite and well-born, closed to those who are not white or Protestant," he wrote in a letter to 5,000 Republicans statewide.

Although recent polls show him trailing by 10 points, Shamie could prove hard to beat. He was endorsed by many GOP town and county officials before Richardson jumped in.

In a campaign where all candidates have pledged not to take political action committee funds--the first PAC-free race in the nation--Shamie, who spent $1.2 million of his own money against Kennedy in 1982, can draw on a personal fortune estimated at more than $20 million. Richardson's net worth, according to financial disclosure forms, is about $800,000, excluding his homes in McLean, Va., and on Cape Cod.

With tax-cutting speeches and unabashed support of President Reagan's defense and foreign policy, Shamie appeals to a GOP electorate that has become increasingly conservative, as the sons and daughters of moderate Republicans have defected to the Democratic Party.

"Elliot represents the establishment," said Shamie, an engineer who pioneered in high-technology manufacturing. "We have enough professional politicians . . . . He's a liberal Rockefeller-type Republican who would be very comfortable in the Democratic Party."

While Shamie is trying to nudge Richardson to the left, Democrats Shannon and Kerry are busy debating which of them is "most electable against Elliot" as they slug it out in what seems likely to be a bitter, close primary. Democrats make up 48 percent of the electorate, but the 39 percent of voters registered as independent can vote in either party's primary.

"If Elliot Richardson gets elected to the Senate, are you ever going to see him in Massachusetts?" Shannon asked a group in Boston's South End. "He has a resume' a pack mule couldn't carry, but he's not going to light any fires in the U.S. Senate."

Shannon, 32, has been endorsed by House Speaker Thomas P. (Tip) O'Neill, and by many of the most politically active feminist groups and labor unions. After spending $100,000 on television ads, he got a big boost by winning the endorsement of Democratic state convention delegates 53 to 47 percent over Kerry.

A poll two weeks earlier, however, showed Kerry, the only Democrat to have run statewide, nine points ahead of Shannon among likely primary voters. A former prosecutor, Kerry, 40, has high name recognition, due not only to his anti-war activity but to a job as a local television commentator.

The same poll, by MRK Research of Boston, showed Richardson beating Kerry by 5 points head-on, Shannon by 19 points and Bartley by 25 points. Connolly, a long shot, was not included.

But Democrats say Richardson is vulnerable on the volatile issue of war and peace, pointing to his involvement in Vietnam and his refusal to endorse an immediate cutoff of aid to CIA-funded rebels in Nicaragua.

Kerry, known for an ego to match his 6-foot-4 height, projects confidence. "No one has a clue what Elliot stands for," he said in an interview. "The moment I get him into a debate, he'll fold . . . . I was in the leadership fighting the war while Elliot was defending the war in Cambodia. When he says he was secretary of defense, I can say, 'Listen, fella, I was in those rice paddies' . . . . If I were Elliot Richardson, I wouldn't want to run against me."

Unflappable, Richardson asserts that, in Vietnam, "I did not believe we should simply cut and run . . . . I never believed we should abandon both our commitments and our efforts to seek a negotiated solution." In Latin America, he supports a "multilateral Monroe Doctrine" that would ban military advisers and bases, Soviet and U.S. alike.

Even if Charles Colson, Nixon's Machiavellian political operative, once praised Richardson as above all "a team player," the former attorney general is counting on his reputation as Mr. Clean, the man who resigned rather than fire Watergate prosecutor Archibald Cox.

However, this flint-faced blueblood, mocked by Shamie as a Clark Kent look-alike, hampered by a dull speaking style that wanders off on esoteric tangents, has had to work hard to brighten his image.

At the Dorchester Day parade, "Muggsy" pressed the flesh beside the Blarney Stone Tavern with unabashed enthusiasm, his campaign posters adorned with shamrocks.

Collecting signatures to place his name on the ballot, he showed up in old clothes at town dumps.

"You should have seen the look on people's faces when Elliot Richardson helped them unload their garbage," said campaign manager Bill McInturff. "They were blown away."