WHEN THE KENNEDY Center opened on Sept. 8, 1977, its first music was by Leonard Bernstein, who wrote "Mass" to celebrate one of the major events in the cultural life of this city and country. Thus it is appropriate that Tuesday night, when Leonard Bernstein returns to the Kennedy Center, he will be here to celebrate with new music.

With two world premieres, Bernstein, who will appear as composer and conductor, will be celebrating the arrival of Mstislav Rostropovich as music director of the National Symphony. For such a celebration, Bernstein has created a unique score in "Songfest," settings of 13 poems by American poets who worte from the mid-17th century to the present.

Bernstein has already discussed "Songfest" as a work of eclecticism. That word as used in a accusation against "Mass" when it was new. But a quick look at some of the finest of Bernstein's compositions over a 30-year period shows that, with his discriminating use of an eclectic style, he has often achieved the best results.

In music as widely divergent as his Serenade for solo violin with orchestra, based on the dialogues of Plato, his "Jeremiah" Symphony, which draws its strength from that prophet's lamentations, or his great depiction of family and social differences in "West Side Story," Bernstein's ability to turn to a wide variety of sources has proven one of his greatest gifts.

This is just as true if you consider his profoundly moving "Chichester Psalms," his troubled reflections on Auden's "Age of Anxiety," or his driving energy in "On the Town." As for "Mass," which has in its six years of busy life found immediate and enthusiastic response with audiences from Europe to Hawaii, its music sounds more precisely right in scene after scene at every rehearing.

In "Songfest," with Bernstein conducting, six American singers will be heard in solos, duets, a trio and three sexlets. Through the poems and the music, the composer has worked to draw a compsite picture of America's artistic past, as seen in 1976 through the eyes of a contemporary artist. He has envisioned this picture through the words of 13 poets, covering 300 years of the country's history. The subject matter of the poetry is the American artists experience as it relates to his or her creativity, loves, marriages or minority problems (blacks women homosexuals, expatriates) with a fundamentally Puritan society.

Two of the 13 poets won Pulitzer prizes for their work Edna St. Vincent Millay and Conrad Aiken, who was for two years consultant in poetry to the Library of Congress. Two others, Lawrence Ferlinghetti and Gregory Corso, were leading writers of the so-called "San Francisco school."

Bernstein has spoken freely of the strongest binding musical force in the cycle as "an unabashed eclecticism, freely reflecting the pluralistic nature of our most eclectic country." Other poems in "Songfest" are by Frank O'llara Julia de Burgos, Walt Whitman, Langston Hughes, June Jordan, Anne Bradstreet, Gertrude Stem, c. c. C cummings and Edgar Allan Poe. The Whiteman poem: "To What You Said," is not from "Leaves of Grass," but was found not long ago among his papers. The poem by Julia de Burgos, who was Puerto Rican and died in New York City in 1953 at 39, has been translated from Spanish by Bernstein's daughter, Jaime.

The final poem, Poe's "Israfel," is an impassioned hymn of praise to him whom the Koran calls the archanged of music. In Gertrude Stem's "Storyette H.M." the initials are those of painter Henri Matisse, who was among the group often seen around the famous American expatriate in Paris.

Bernstein's scheme for "Songfest" frames the whole in opening and closing hymns, sung by all six soloists. Balancing Poe's poem to music at the end is Fran O'Hara's opening "To the Poem." As the opening hymn is followed by three solos, so the closing hymn is preceded by three solos. In between Bernstein has placed two duets, decided by a trio, and followed by a sextet setting of cummings' poem. "If you can't eat you got to."

The earliest poem in the cycle is "To My dear and Loving Husband," writes in 1650 by Anne Bradstreet who loved in North andover in the Massachusetts Bay Colony. This song, dedicating to Rosalynn Carter, was sung at last January's Inaugural Concert in the Kennedy Center. It is one of the four songs for "Songfest" that Berstein completed some time ago. Originally the new work had been planned as a port of the Becentennial celebration. But 1976 came and went before Berstein could finish his unusal assignment.

By the time he had completed the work, he had added settings of "The Pennycandystore Beyond the El," by Ferlinghetti, "I, Too, Sing America," by Langston Hughes, "Okay, Negroes," by June Jordan, "Music I Heard With You," by Conrad Aiken, "Zizi's Lament," by Gregory Corso, and "What Lips My Lips Have Kissed," by Edna St. Vincent Millay.

"Songfest," Berstein's first major work since his 1974 ballet "Dybbuk," is only one of the world premieres that will mark Tuesday night's celebration. The concert will open with Rostropovich conducting Berstein's suite from the 1955 film "On the Waterfront." Then, with Bernstein as conductor, Rostropovich will take up his cello to play the first performances of Three Mediatations from the "Mass" music that opened the Kennedy Center. Berstein arranged two of the Meditations for cello and piano some time ago at Rostropocvich's request.

But this week marks the first hearing of all three in the recently complated version for cello and orchestra. In "Mass," the first two Mediatations serve as interludes in the action. The third is taken from various parts of the score, drawing upon the Communion, Secret Songs and the Chorale.

The soloist in "Songfest" will be so-piano Clamma Dale, mezzo Rosalind Elias, contralto Nancy Williams, tenor Neil Rosenshein, baritone John Reardon and bass Donald Gramm.