The Magic Flute ( German : Die ZauberflÃ te , K. 620 ) is an opera in two acts composed in 1791 by Wolfgang Amadeus Mozart . The Magic Flute ( , K. 620 ) is an opera in two acts composed in 1791 by Wolfgang Amadeus Mozart to a German libretto by Emanuel Schikaneder .