All-NBA guard Earvin (Magic) Johnson of the Los Angeles Lakers was looking for a community service project recently, and what he found has resulted in what its promoters are calling the first NBA Summer All-Star Game, to be played Saturday night at Capital Centre.

The name is slightly misleading, since the game is not under the auspices of the National Basketball Association, but only sanctioned by the league as a charity exhibition. Under the league's collective bargaining agreement, NBA players may perform only in offseason exhibition games sanctioned by the NBA office, according to Gary Bettman, the league's general counsel, and the profits from the games must go to charities recognized by the Internal Revenue Service.

The beneficiaries Saturday night will be the National Stay in School Program and the National Committee, Arts With the Handicapped. According to Chuck Hatcher, president of Concerned Pro Athletes in Action, which runs the stay in school program, nine of the 20 players who made the NBA All-Star teams have committed to play in the 7:30 game.

Johnson's Red team will include Isiah Thomas of the Detroit Pistons, Mark Aguirre of the Dallas Mavericks, George Gervin of the San Antonio Spurs, Herb Williams of the Indiana Pacers, Kenny Carr of the Portland Trail Blazers and Larry Spriggs of the Lakers. Uwe Blab, a 7-foot-2 center from Indiana University who was drafted by the Mavericks, will make his pro debut.

The Blue team will include Dominique Wilkins of the Atlanta Hawks, another key player in organizing the game; Andrew Toney of the Philadelphia 76ers; Eric Floyd of the Golden State Warriors and formerly of Georgetown University; Jeff Malone and Dudley Bradley of the Bullets; Gene Banks of the Spurs; Tree Rollins of the Atlanta Hawks, and rookie Gerald Wilkins, Dominique's brother and the Knicks' No. 2 draft choice.

Johnson was attending a family reunion yesterday and was unavailable to comment, according to Dr. Charles Tucker, his adviser and longtime friend in Lansing, Mich. Tucker said Johnson is asked to play in about 20 charity games annually, and he selects four. Johnson made his pro debut in a National Stay in School Program game, and Tucker said he chose this game because of the Art With the Handicapped's sponsorship by the Kennedy Foundation.

"This is Magic's motivation. He put the game together," said Eugene Maillard, chief executive officer of the National Committee, Art With the Handicapped, which also is affiliated with the John F. Kennedy Center for the Performing Arts. "Magic and Dominique Wilkins wanted to do some educational program for kids, and they wanted it international in scope."

Maillard said his organization has a five-year contract with Concerned Pro Athletes in Action for the "NBA Summer All-Star Game." Both he and Hatcher said foreign tours are planned, taking advantage of the Art With the Handicapped's involvement in 35 foreign countries.

Advance paid ticket sales were only at 1,250 as of late yesterday, but the Coca-Cola Co., a corporate sponsor, has distributed 5,000 tickets to disabled and nondisabled youth, according to Maillard.

Concerned Pro Athletes in Action has been putting together summer exhibition games since 1969, when then-Mayor Frank Rizzo of Philadelphia sought help in curtailing gang fights, according to Hatcher. Wilt Chamberlain, Billy Cunningham, Wally Jones and Walt Hazzard organized the game and, according to Hatcher, deaths related to gang fights dropped from about 100 the previous summer to six.