We demonstrate a microvalve-assisted patterning (MAP) platform to realize 3D cell culture in a microenvironment and in situ cell-based assays (CBAs) by forming a linear drug concentration gradient. The MAP platform was fabricated by multilayer soft lithography and applied to CBAs for confirming the uniformity of cell distribution, concentration gradient profile, and reliability of fabricated matrix. In addition, hepatotoxic effects by ethanol were investigated with human hepatocellular liver carcinoma cells (HepG2) in real-time monitoring. This approach provides not only exact fluids control, bubble removal and stable solution exchange, but also reliable scaffold fabrication, 3D cell culture and CBAs.