The Shape Of You star will voice character Brendan on the show in a musical-themed special.
It will feature in the show's 29th season, which begins in October.
Executive producer Al Jean told news website Entertainment Weekly that Sheeran's part, which unsurprisingly includes singing, was recorded over the phone from the UK.
Commenting on the new face, who woos saxophonist Lisa Simpson with his music, Jean said: "We had a perfect part for him...So we said, 'Oh, great, we'll have him do this!' And we recorded him over the phone from England."
Sheeran's expanding foray onto the small screen adds to a successful year for the 26-year-old, who has dominated the album charts this year with his third album, Divide, and last month headlined the Glastonbury Festival.