Biopsies provide required information to diagnose cancer but, because of their invasiveness, they are difficult to use for managing cancer therapy. The ability to repeatedly sample the local environment for tumor biomarker, chemotherapeutic agent, and tumor metabolite concentrations could improve early detection of metastasis and personalized therapy. Here we describe an implantable diagnostic device that senses the local in vivo environment. This device, which could be left behind during biopsy, uses a semi-permeable membrane to contain nanoparticle magnetic relaxation switches. A cell line secreting a model cancer biomarker produced ectopic tumors in mice. The transverse relaxation time (T(2)) of devices in tumor-bearing mice was 20+/-10% lower than devices in control mice after 1 day by magnetic resonance imaging (p<0.01). Short term applications for this device are numerous, including verification of successful tumor resection. This may represent the first continuous monitoring device for soluble cancer biomarkers in vivo.