In this paper, we present a framework for physical rehabilitation, that uses a combination of video gaming and robotic technology to allow the monitoring and progress tracking of a person during physical therapy. The system, called MAGNI, uses the advanced control capabilities of the Barrett WAM Arm robot and a custom-made video game. The MAGNI system helps the patient to complete a rehabilitation session through a user-system, game-based interaction program, involving exercises prescribed by a therapist. The system can control and supervise the rehabilitation sessions to ensure compliance and safe exercising. It uses motion analysis to provide an evaluation of the patient's progress over time. The MAGNI system records the position of the subject's hand during game interaction with the robotic arm and analyzes this data using pattern matching and machine learning algorithms, in order to guide self-managed physical therapy. Our experiments show that we can accurately classify user motion activity between a set of different exercises, and measure user compliance with the prescribed regimens.