Kennedy's close ties with Republican (GOP) Senator Joseph McCarthy strengthened his family's position among Irish Catholics, but weakened it among liberals who strongly opposed McCarthy. Even before McCarthy became famous in 1950, Kennedy had forged close ties with the Republican Senator. Kennedy often brought him to his family compound at Hyannis Port as a weekend house guest in the late 1940s. McCarthy at one point dated Patricia Kennedy.  When McCarthy became a dominant voice of anti-Communism starting in 1950, Kennedy contributed thousands of dollars to McCarthy, and became one of his major supporters. In the Senate race of 1952, Kennedy apparently worked a deal so that McCarthy, a Republican, would not make campaign speeches for the GOP ticket in Massachusetts. In return, Congressman John F. Kennedy, running for the Senate seat, would not give any anti-McCarthy speeches that his liberal supporters wanted to hear.  At Kennedy's urging in 1953, McCarthy hired Robert Kennedy (age 27) as a senior staff member of the Senate's investigations subcommittee, which McCarthy chaired. In 1954, when the Senate was threatening to condemn McCarthy, Senator John Kennedy faced a dilemma. "How could I demand that Joe McCarthy be censured for things he did when my own brother was on his staff?" asked JFK.  By 1954 Robert F. Kennedy and McCarthy's chief aide Roy Cohn had had a falling out, and Robert no longer worked for McCarthy. John Kennedy had a speech drafted calling for the censure of McCarthy but he never delivered it. When the Senate voted to censure McCarthy on December 2, 1954, Senator Kennedy was in the hospital and never indicated how he would cast his vote. Joe Kennedy strongly supported McCarthy to the end.

Answer this question "What was their agenda?" by extracting the answer from the text above.
When McCarthy became a dominant voice of anti-Communism starting in 1950, Kennedy contributed thousands of dollars to McCarthy, and became one of his major supporters.