MOSFIRE is a unique multi-object spectrometer and imager for the Cassegrain focus of the 10 m Keck 1 telescope. A refractive optical design provides near-IR (0.97 to 2.45 μm) multi-object spectroscopy over a 6.14' x 6.14' field of view with a resolving power of R~3,270 for a 0.7" slit width (2.9 pixels in the dispersion direction), or imaging over a field of view of 6.8' diameter with 0.18" per pixel sampling. A single diffraction grating can be set at two fixed angles, and order-sorting filters provide spectra that cover the K, H, J or Y bands by selecting 3rd, 4 th , 5 th or 6 th order respectively. A folding flat following the field lens is equipped with piezo transducers to provide tip/tilt control for flexure compensation at the 0.1 pixel level. A special feature of MOSFIRE is that its multiplex advantage of up to 46 slits is achieved using a cryogenic Configurable Slit Unit or CSU developed in collaboration with the Swiss Centre for Electronics and Micro Technology (CSEM). The CSU is reconfigurable under remote control in less than 5 minutes without any thermal cycling of the instrument. Slits are formed by moving opposable bars from both sides of the focal plane. An individual slit has a length of 7.1" but bar positions can be aligned to make longer slits. When masking bars are removed to their full extent and the grating is changed to a mirror, MOSFIRE becomes a wide-field imager. Using a single, ASIC-driven, 2K x 2K H2-RG HgCdTe array from Teledyne Imaging Sensors with exceptionally low dark current and low noise, MOSFIRE will be extremely sensitive and ideal for a wide range of science applications. This paper describes the design and testing of the instrument prior to delivery later in 2010.