A federal judge here sentenced a former official of the Federal Energy Administration to three years' probation for accepting a gratuity in 1977 from former CIA agent Edwin P. Wilson in exchange for helping Wilson obtain a contract with the FEA for a computer consulting company.

The official, Paul Cyr, 61, pleaded guilty in July to one count of agreeing to receive a gratuity and another of receiving that gratuity. U.S. District Judge John H. Pratt imposed the sentence, along with a $5,000 fine. As a condition of his probation, Cyr will perform 20 hours of community service each week for three years.

According to statements filed by prosecutors, Wilson -- who is in federal custody in New York, accused of shipping explosives to Libyan ruler Muammar Qaddafi -- acted as a middleman between Cyr and representatives of a Washington-based company, and Cyr introduced those representatives to FEA staff. The company received a subcontract from the FEA, now the Department of Energy, for $26,000, and Cyr was to get between $3,000 and $6,000 for his assistance, according to prosecutors.

In a statement before he was sentenced, Cyr told Pratt that he believed Wilson was working for the CIA at the time because he personally attended meetings between Wilson and Theodore P. Shackley, who retired in 1979 as associate deputy director of CIA operations.

Cyr said that at those meetings, which were unrelated to the charges against him, Wilson agreed to try to obtain from the Libyan government a Soviet antiaircraft missile and a Mig26 jet fighter.

Shackley has acknowledged that he privately received some intelligence information from Wilson, but he and the agency have repeatedly denied that they in any way condoned or were connected with Wilson's activities in Libya.