A floating multi-purpose robot built by the immortal Flint to serve as butler, gardener, laboratory technician and guard on his private planet Holberg 917-G.
M-4 appears in the episode Requiem for Methuselah. When Kirk, Spock and McCoy beam down to Holberg 917-G in search of ryetalyn to cure an outbreak of Rigelian fever, the machine confronts them and disables their phasers before Flint calls it off.
The robot drifts silently through the air and carries out whatever its master requires. Flint sets it to gathering and processing the ryetalyn, though its first batch is contaminated and useless.
Later, finding Kirk kissing Flint's ward Rayna, the robot moves to attack him and Spock destroys it with a phaser. Flint is unconcerned; a replacement is working within hours. The machine is an early sign of the skill that also produced Rayna, who is herself an android.