Stewart B. McKinney, 56, a Connecticut Republican who had served in Congress since 1971 and was ranking minority member of the House District of Columbia Committee, died at the Washington Hospital Center yesterday of pneumonia brought on by AIDS.

In a statement issued by McKinney's office, his physician, Dr. Cesar Caceres, said: "I believe that Mr. McKinney contracted the disease from the many blood transfusions he received while undergoing multiple-heart-bypass surgery in 1979. This was during the window period between 1978 and the spring of 1985 when no testing of blood donors for {the virus that produces AIDS} was done."

The statement said McKinney tested positive for the AIDS virus 18 months ago, but that the disease was not diagnosed until he entered the hospital April 22.

Knowledgeable sources on Capitol Hill and in the gay community said McKinney had had homosexual relationships. Homosexual men are at greatest risk for AIDS.

Lucie McKinney, the representative's widow, said last night when informed of the assertions by the sources that her husband had homosexual relationships:

"Stewart and I had long communications before he died and knew that his death would be used by certain people. The children knew him as a very good father, and I knew him as a wonderful husband who was very caring for people. I know that right now he would have liked us to look forward and not look behind, and get help in finding a cure for this disease, however we look at how people get it."

About 700 of the 34,000 cases of acquired immune deficiency syndrome that have been reported to the Centers for Disease Control occurred as a result of blood transfusions. CDC officials say that the risk of contracting AIDS through a blood transfusion was smaller in 1979 than it was in 1985. With the introduction of an accurate test, medical officials now say that the blood supply is safe.

McKinney had suffered two heart attacks and at different times from pneumonia, psoriasis, hepatitis and mononucleosis. In November 1985, he was hospitalized for double pneumonia.

In addition to his work on the District committee, McKinney was the second-ranking Republican on the Banking, Finance and Urban Affairs Committee. Over the years, he was an eloquent proponent of federal housing programs, home rule for the District of Columbia, and programs to help Amerasian children and the homeless.

As the former chairman of the banking committee's economic stabilization subcommittee, he had played a leading role in drawing up the loan guarantees to New York City, the Chrysler Corp. and the national synthetic fuels program.

McKinney was such a strong friend of the District and its quest for home rule that he was described by Del. Walter E. Fauntroy (D-D.C.) as "my vote on the House floor." He was an author of the 1973 D.C. Home Rule Act.

Mayor Marion Barry ordered flags on District buildings flown at half-staff in McKinney's honor and issued a statement in which he said:

"Congressman McKinney was one of the key authors of the home rule charter and a staunch supporter of self-government for the District of Columbia. He understood, at a time when few congressmen did, that participatory democracy should be for everyone, including the citizens of the District of Columbia."

There were occasions, however, when McKinney questioned actions by the city government. In 1981, he took the Barry administration to task for proposing to meet short-term debts through the sale of municipal bonds. He pointed out that bonds were extremely expensive, the District's books were a mess, and the city government should be able to acquire the money through the sale of unused city properties.

While few disagreed with McKinney's analysis, the city maintained that it wanted to sell bonds. McKinney withdrew his objections, largely in the spirit of home rule.

He also objected to city administrative failures, including one that resulted in the water in his house being shut off for several days despite the fact that he had a canceled check to prove that he had paid his water bill. However, he seemed to applaud the city when his car got "booted," pointing out that home rule had come a long way from the day when a member of Congress never got a traffic ticket.

In addition to District residents, he spoke for others who had little or no voice in federal affairs, or whose views were unpopular to many.

In the 97th Congress, he saw the passage of his Amerasian Immigration Act, which gives children of U.S. servicemen in Asia similar priorities in the right to obtain visas as all other children of American citizens.

He once said, "These are our children. They have been abandoned in a society which does not recognize them as people because they are not pure, to a people which does not look at them as they walk down the street, unless it is to call them dirty names. And their only sin is that they have U.S. fathers."

He also spoke of the plight of the homeless, many of them former patients at mental institutions. He sought new legislation that would substitute treatment that emphasized deinstitutionalization with care that put the greatest emphasis on what was therapeutically best. He also was one of 73 congressional sponsors of a gay civil rights bill.

As ranking member of banking committee's housing and community development subcommittee, he devoted an increasing amount of time to housing legislation. As a supporter of Community Development Block Grants and Urban Development Action Grants, he was in firm opposition to the Reagan administration.

On budget issues, McKinney became known as one of the "Gypsy Moth" Republicans of the early Reagan years who supported the president on his 1981 budget and tax programs while carefully looking out for the interests of their own districts. Increasingly, he took on a more visible role as economic spokesman for House liberal Republicans. Only three House Republicans opposed their party's congressional program more often than he did.

McKinney, who maintained residences in Washington and Westport, Conn., was born Jan. 30, 1931, in Pittsburgh. He attended Princeton University and earned a bachelor's degree at Yale University. He served in the Air Force from 1951 to 1955.

He was a tire dealer in Fairfield before becoming active in Republican politics. He lost his first bid for office, for town selectman in 1965, but won a seat in the Connecticut House the following year.

He succeeded Republican Lowell P. Weicker Jr., who was elected to the U.S. Senate in 1970, as representative from the 4th District.

Survivors include his wife of 37 years, the former Lucie Cunningham, and five children, Stewart Jr. and Lucie, both of Fairfield, Conn., John, of Westport, Elizabeth (Libby), of Raleigh, N.C., and Jean, of Buffalo, and three grandchildren.