The process in which the anatomical structures of the middle ear are generated and organized. The middle ear is the air-filled cavity within the skull of vertebrates that lies between the outer ear and the inner ear. It is linked to the pharynx (and therefore to outside air) via the Eustachian tube and in mammals contains the three ear ossicles, which transmit auditory vibrations from the outer ear (via the tympanum) to the inner ear (via the oval window).