Washington Cathedral Dean Francis B. Sayre Jr., who shepherded construction of the massive Gothic cathedral for 25 years and made its pulpit a conscience for the community and the nation, announced yesterday that he would retire next January.

Dean Sayre submitted his resignation effective Jan. 17, his 63d birthday - to the Cathedral Chapter, or governing board, which accepted it "with regret." A spokeman for the chapter said a search would begin soon for a successor.

In the quarter century that he has served as dean of the Episcopal Cathedral Church of St. Peter and St. Paul, Dean Sayre has taken up causes that ranged from outraged attacks on the McCarthyism of the 1950s to the civil rights and antiwar movements of more recent years.

But he still was able to devote considerable time and energy to the continuing planning and building of the magnificent cathedral structure that in many respects is America's counterpart to England's Westminster Abbey.

Under his leadership, the cathedral, which was begun in 1907, received 50 per cent of the stained glass now in place - including the remarkable west rose window installed last year. He also was responsible for the completion of the South transept, the central tower, the west facade and the completion of the nave.

Under Dean Sayre's leadership the cathedral has been open to the community to a far greater extent than is usually true of such structures. While it remains unmistakably Episcopalian, its facilities are available to other religious group, both in and out of the Christian ttradition.

At least one Jewish congregation - Temple Sinai - met regularly in the cathedral until its own structure on Military Road was completed.

The public is welcomed to the cathedral at special musical and dramatic events as well as the regular worship services and such special events as the annual flower mart and Cathedral Days.

Unlike other churches, the Washington Cathedral has no parish of its own. The lanky 6-foot-2 dean views the entire capital city as his parish.

In an interview last spring, he defined his vision of the role of the cathedral, located on Mt. St. Alban, in relation to "that other hill - Capitol Hill - where the decisions that affect the whole nation are made."

It is the role of the cathedral on its hill to assess those decisions, to see that they are "rooted in the humanity which we all share as a nation . . . When they are not rooted in that (humanity) they will be divisive," he said.

He has not hesitated to speak out when he felt the decision makers across town were wrong. In 1954, he used his pulpit to attack Sen. Joseph R. McCarthy and his Communist-hunting tactics.

"Jim Pike and I swapped pulpits - we were the first anywhere to speak out" against McCarthy, he recalled of the era when criticism of McCarthy carried grave risk of being branded as a Communist or fellow-traveler.

"I got bushels and bushels of letters from all over the country - mostly attacking me," he said. "But I felt the Church had a very profound role to play."

He was equally outspoken in the years of the civil rights movement and was one of the clergy who responded to the call of Martin Luther King, Jr. for help in the Selma, Ala., struggle for voting rights.

During the antiwar movement of the late 1960s and early 1970s, the cathedral became a major rallying point for opponents of the nation's involvement in Vietnam. In January, 1973, thousands packed the cathedral and others stood outside in a cold rain to be part of a "counter-inaugural" concert by Leonard Bernstein.

In 1971, Dean Sayre traveled to South Africa to come to the aid of a fellow Anglican cleric, the Rev. Gonville Ffrench-Beytagh of Johannesburg, who had been arrested for his opposition to restrictive racial laws in that country.

In 1972, Dan Sayre generated a bitter controversy among many of the liberals who usually supported him. In a Palm Sunday sermon, he sharply criticized Israel for "oppressing" Arab residents of Jeruselam and other territories taken by Israel in the Six-Day war.

Six months later, he added fuel to the fire by further criticism of Israel - this time for its air attacks on Syria and Lebanon in retaliation for the slaying of Israeli atheletes at the Olympics.

The dean readily acknowledges that his outspoken positions on controversial issues has cost the cathedral thousands of dollars, but he defends the course he has followed.

"Whoever is appointed the dean of a cathedral has in his hand a marvelous instrument and he's a coward if he doesn't use it," he said.

In the past two years, the dean pushed the cathedral's building program to the limits of the institution's budget and a bit beyond, in order to finish the nave and install the west rose window in time for the bicentennial - and the visit of Queen Elizabeth last July.

The heavy building expenses, combined with inflation, created a fanancial crisis for the institution, and earlier this year the chapter ordered stringent economies.

But in spite of - or perhaps because of - the financial difficulties, contributions for the day-to-day operating budget of the cathedral - up this year by a third.

The annual fund appeal, which usually nets about $300,000, already has brought in nearly $400,000 this year, with another month to go, reported s public relations director