HARTFORD, June 17— George Griffin was Mark Twain's butler for 18 years, but he was much more than that. Historians say he was also the inspiration for the character of Jim, the runaway slave, in "The Adventures of Huckleberry Finn."

Despite his importance to Twain, Mr. Griffin's tiny third-floor room in the Mark Twain Memorial, a museum here and the author's longtime home, has been closed to visitors, the space filled with a heating and cooling system that hums and shudders throughout the day.

By next year, that will change.

Thanks to more than $200,000 in gifts and grants, the heating equipment is being moved and Mr. Griffin's room is being restored to reflect his life -- and the life of black people in Hartford in the 19th century.

"Our commitment to George's legacy," said John Boyer, the museum's executive director, "is part of the larger effort we're making in discovering Mark Twain's involvement with the African-Americans in this community. Twain had very special feelings about George's role in the family, and he played a big part in their lives." 'Devoted Friend'

Mr. Griffin, who, as Twain liked to say, "came one day to wash the windows and stayed for 18 years," was a friend, confidant, adviser on legal and literary matters and playmate to Twain's children, officials of the museum say.

In an unpublished manuscript, Twain, whose real name was Samuel L. Clemens, describes Mr. Griffin as "shrewd, wise, polite, always good-natured, cheerful to gaiety, honest, religious, a cautious truth-speaker, devoted friend to the family."

He also wrote of the reaction he and Mr. Griffin encountered as they walked into the Century Building in New York:

"A white man and a negro walking together was a new spectacle to them. The glance embarrassed George but not me, for the companionship was proper; in some ways, he was my equal, in some others my superior; and besides, deep down in my interior I know that the difference between any two of those poor, transient things called human beings was but microscopic, trivial, a mere difference between worms."

The actor Hal Holbrook, who has been portraying Twain in "Mark Twain Tonight" for more than 30 years, was pleased to hear of the Griffin room restoration.

"I hope this helps," he said, referring to misconceptions about Twain regarding race and prejudice. "Twain's story of how George came to the house and stayed for 18 years says something about the family and their treatment of people." He said many people misread "The Adventures of Huckleberry Finn" as racist, when it instead satirizes prejudice. A Waiter and a Deacon

Mr. Griffin's birth date and details of his early life remain a mystery, but much in his later years is well documented. A former slave, he worked as a servant in the Civil War, then went to Hartford, where he was a waiter. He was also a deacon in the African Methodist Church and a city political leader.

Married to a dressmaker named Mary and the father of a daughter, Mr. Griffin had owned a house in the city but always kept his room at the Twain house.

The restoration is being financed by $170,000 grant from the National Endowment for the Humanities to remove and replace the heating system and a gift of $30,000 to work on the room from Eleanor Bunce of Bloomfield, a longtime supporter of the Mark Twain Memorial.

No pictures of either Mr. Griffin or his room are known to exist, so it will be difficult to re-create how it truly looked, but the curator, Marianne Curling, intends to get as close as possible. At Least Two Mattresses

The paint layers will undergo chemical analysis to determine the room's original color and could reveal whether three floor-to-ceiling closets were there in Mr. Griffin's time.

Ms. Curling also said she will look at references concerning how Mr. Griffin used the room. For instance, she said, in one written account Mr. Twain tells of Mr. Griffin's running up to his room to make sure than $1,500 was still stuffed between his mattresses. "From that," she said, "we know he had at least two mattresses -- and there are other similar references."

Officials here like to think of the room restoration as also restoring the closeness between Mr. Griffin and Twain's family.

When Mr. Griffin died in 1897, a year after Twain's daughter Suzy Clemens died, Twain took special care to mention him in a letter to a friend: "Suzy is gone, George is gone . . . our friends are passing one by one; our house where such warm blood and such dear blood flowed so freely, is become a cemetery. But our dead are welcome here; their life made it beautiful, their death has hallowed it. We shall have them with us always and there will be no parting."

Photos: The butler's room in the Mark Twain Memorial, a museum, and the longtime home of Mark Twain, is being renovated to reflect the life of its former occupant, George Griffin, and other black people of the 19th century. (Steve Miller for The New York Times); The house in Hartford where Mark Twain lived from 1874 to 1891 is a museum. (Mark Twain House, Hartford, Conn.)