Mayor Harry W. Kelley of Ocean City came to Washington yesterday and told the Senate Judiciary Committee that "they may have to know how to deal with "those big birds" who run the major oil compaines, they should listen to "this ole country boy."

Kelley told the Judiciary Committee Chairman, Sen. Edward M. Kenedy (D-Mass.), how he singlehandedly averted a gasoline shortage in his resort town by this simple method: "We bought it [300,000 gallons gasoline] and we buried it."

"I whipped 'em," said Kelley, implying that the United States Senate could also, if its members would refuse to accept the "ridiculous" contention that oil companies don't have to tell them how much oil they have in reserve.

An aide to Kennedy said Kelley was invited to testify so the committee could find out how "the man on the street" feels about legislation pending before the committee.

The bill in question, sponsored by Kennedy and Sen. Howard Metzenbaum (D-Ohio) would prohibit the nation's 16 largest oil compaines from buying any company, regardless of its product, if the sale involved more than $100 million.

The idea, Kennedy explained, was to force the oil companies to use their profits in the search for new energy, rather than diversify by acquiring departmment stores, a halth-care equipment firm, a copper company and even a circus, as some have done recently.

The irrepressible Kelley, who confided before the hearing that he was "an old hand" at testifying before congressional committes, did not disappoint backers of the legislation.

He engaged an opponent of the bill, Sen. Orrin G. Hatch r-utah), in a philosophical give-and-take, and then offered to take Hatch "out on the street, where you'll find no bleeding hearts for the oil companies. Four out of five people don't trust them."

When Sen. Strom Thurmond (R-S.C.), another opponent of the bill, pointed out that a number of experts had testified against it at a previous hearing, Kelley shot back, "I'm sick and tired to experts. It's time to listen to someone with common sense."

It took a roll-call vote to interrupt the loquacious Kelly. "Do you want me to stay?" asked Kelly, to which Kennedy replied, "You might stay here all morning long."

Kelley did. In fact, he even ignored Kennedy's later suggestion that maybe enough was enough; there were other witnesses, including distinguished professors who had flown in from Stanford, Cornell and Tulane.

"That's all right, I've got the time," the mayor told a nonplussed Kennedy.

Before the show was over, Kelly's private bodyguard and press agent, Ocean City police officer William Kerns, distriuted keys to the city to all the senators, including one to Kennedy that was framed and ready for mounting.

As he left the room, the bald, sunburned Kelley turned to Kennedy, waved, and called, "come see me, senator." CAPTION: Mayor Harry W. Kelley: ". . . no bleeding hearts for the oil compaines." By James K. W. Atherton - The Washington Post