In this paper, we present a microelectromechanical systems-based two-degrees-of-freedom positioning device combined with a clamping structure for positioning and constraining an optical fiber. The fiber position can be controlled in the two directions perpendicular to the fiber axis using two specifically designed wedges that can be accurately moved in-plane. These wedges are positioned using in-plane thermal actuators. Actuation of a fiber tip greater than 25 mu m in-plane and 40 mu m out-of-plane is achieved with a displacement resolution better than 0.1 mu m. After aligning the fiber the final position can be maintained by switching off the mechanical clamp, which also uses thermal actuators. The position of the fiber can be kept within 0.1 mu m after switching off the mechanical clamp and the positioning actuator. Fiber-to-fiber alignment experiments have been performed and the technique can be extended to fiber-to-laser alignment.