Magic Carpet is a first-person perspective game, in which you are a mage who flies on a, well, magic carpet and casts spells. The game has 50 levels, called "worlds"; each of those is set in a sea terrain with several mountainous islands. Your goal on each level is to amass enough mana within your castle to "restore the equilibrium" within the world. Once this happens, you can head to the next level.
To collect mana, you have to find it (it is represented by golden spheres) and cast a specific spell to make it "yours". To collect this mana, you have to use a special spell to raise a castle of your own out of the ground. A balloon will appear over the newly created castle; it will proceed to fly around the level and collect "your" mana. Initially, your castle will be small and won't be able to hold much mana, so you'll have to keep casting the "castle" spell at it to make it bigger.
The levels typically have monsters and rival mages in them. Not only they can hurt you with their attacks, but killing them is often necessary, as upon death they will release some of the mana you need to complete the level. To attack your enemies, you have a variety of spells at your disposal: fireballs, lightning bolts and meteors.
There are also many other spells available to you - they allow you to heal yourself, surround yourself with a protective shield, teleport around, summon a skeleton army, or even modify the terrain by creating volcanoes and splitting landmasses. Not all spells are available to you from the beginning, though.
Throughout all the levels, you are on your flying carpet, which can move in 3 dimensions. You can bring up a top-down map at any time.