Which came first: the music or the musical? In the case of An American in Paris, the music came first. In 1949, MGM snatched up the rights to the late George Gershwin's suite "An American in Paris" (source). That's the tune you hear during Jerry's dream ballet sequence. Even though it comes at the very end of the flick, it's the film's centerpiece, and it's where the title comes from.
All of the songs in An American in Paris are Gershwin jams. Some already existed; others were fleshed out by George's brother and songwriting partner, Ira, who added lyrics (source). Once the songs were squared away, MGM brought on Alan Jay Lerner to write the film's script. Given the movie's roots in Gershwin's suite, we're willing to bet Lerner had one overriding note from the studio as he wrote: your main character needs to be an American, and he needs to be in Paris.