This pilot clinical trial studies magnetic resonance imaging (MRI)-guided stereotactic body radiation therapy (SBRT) in treating patients with liver metastases or liver cancer. SBRT is a specialized radiation therapy that delivers a single, high dose of radiation directly to the tumor and may kill more tumor cells and cause less damage to normal tissue. Combining MRI with SBRT may help doctors to highlight the tissues surrounding the tumor better.