In this article, we present a new three-dimensional printing inspired method for in situ fabrication of mobile magnetic microrobots with complex topology by bending a polymer filament on demand directly inside an enclosed operational environment. Compared with current microrobot fabrication methods that typically involve multiple microfabrication steps and complex equipment, the proposed method is simply and fast. The target shape is formed as the filament is fed through a hot needle inserted into the workspace, and the filament bending moment is induced by attaching a tip magnet at the end of the filament and projecting magnetic fields wirelessly from external electromagnetic coils. The filament bending mechanics and the behavior of the bending zone are analyzed and verified through bending experiment. A shape planner is developed for automatically controlling the fabrication process of any desired planar shapes, and the shape creation potential of this method is also studied. Magnetically active millimeter-scale robotic devices of different planar shapes are fabricated using polylactic acid filament with diameter as small as 100 m. As demonstrations of the in situ formation of functional microrobotic devices, a micro-gripper is fabricated and controlled to assemble a cell cage. A micro-spring is created as a manipulating tool with force sensing capability. We, thus, show the utility of the fabrication method for creating complex microrobot shapes remotely in enclosed environments for advanced microrobotic applications, with the potential for scaled down applications in health care and microfluidics.