A new boron-coated CCD camera is described for direct detection of ultracold neutrons (UCN) through the capture reactions $^{10}$B (n,$alpha$0$gamma$)$^7$Li (6%) and $^{10}$B(n,$alpha$1$gamma$)$^7$Li (94%). The experiments, which extend earlier works using a boron-coated ZnS:Ag scintillator, are based on direct detections of the neutron-capture byproducts in silicon. The high position resolution, energy resolution and particle ID performance of a scientific CCD allows for observation and identification of all the byproducts $alpha$, $^7$Li and $gamma$ (electron recoils). A signal-to-noise improvement on the order of 10$^4$ over the indirect method has been achieved. Sub-pixel position resolution of a few microns is demonstrated. The technology can also be used to build UCN detectors with an area on the order of 1 m$^2$. The combination of micrometer scale spatial resolution, few electrons ionization thresholds and large area paves the way to new research avenues including quantum physics of UCN and high-resolution neutron imaging and spectroscopy.