According to the MIT International Student Office website, one avenue may be to do this work as "off campus work as on campus work". Following is an extract from the ISO website as of March 17, 2016. This is not meant to be a definitive answer - for up to date rules and regulations visit the ISO site directly.
Off-campus work as on-campus work
KIND OF WORK
Work must fulfill all the following three conditions:
(1) Location must be contractually affiliated with MIT
(2)Work must be part of the graduate program curriculum or related to a graduate research project.
(3)The employment must be an important part of the student's program of study.
PART TIME/ FULL TIME
Part-time when school is in session. Full-time during annual vacations.
Authorization by an International Student Advisor at MIT ISO
IMPACT ON PRACTICAL TRAINING
Only Graduate Students are eligible. Students must submit to the International Student Advisor a letter from their academic advisor giving detailed information about the work.
Note that Trust Center is not equipped to provide legal or immigration advice. Please visit the ISO and talk to your advisor, or engage legal counsel who specializes in immigration issues to understand the latest rules and to interpret how these rules and policies apply to your personal situation.