B cell maturation depends on cognate interactions between the T and B cells. Upon interaction with CD40 ligand (CD40L) on T cells, CD40 delivers costimulatory signals alongside B cell antigen receptor (BCR) signaling to regulate affinity maturation and antibody class switch. Mutations affecting CD40-CD40L interactions cause abnormal antibody responses in immunodeficiencies known as X-linked hyper-IgM syndrome (X-HIgM). Here, we study the CD40-mediated mechanotransduction in B cells, which likely occurs during their physical contacts with T cells. We found that CD40 forms catch bond with CD40L that lasts longer at larger forces, both B and T cells exert tension on CD40-CD40L bonds, and force enhances CD40 signaling and antibody class switch. X-HIgM CD40L mutations impair catch bond formation, suppress endogenous tension, and reduce force-enhanced CD40 signaling, leading to deficiencies in antibody class switch. Our findings highlight the role of mechanotransduction in CD40 function and provide insights into the mechanisms underlying X-HIgM syndrome.