We report the MAXI observation of the gravitational-wave (GW) event GW170817 and the electromagnetic counterpart of GW170817. GW170817 is a binary neutron star coalescence candidate detected by the Advanced LIGO and Advanced Virgo detectors, and it is the first event for which the optical counterpart has been discovered. In the MAXI observation, the Gas Slit Camera (GSC) covered approximately 62% of the sky region of the GW event within 90% probability during the first 92 min of orbit after the trigger. No significant X-ray transient was detected in the error region, and the upper limit of the average flux with a significance of 3 $sigma$ in the 2--10 keV band was 53/26 mCrab (one-orbit observation/one-day observation). In the optical counterpart of GW170817, the observational window of GSC at the position started at 20 s after the GW trigger, but the high voltage of GSC was unfortunately off at the time because the ISS was entering a high-particle-background region. The first observation of the position by GSC was eventually performed at 16797 sec (4.6 hours) since the GW trigger, yielding the 3 $sigma$ upper limit of 8.60$times$10$^{-9}$ erg cm$^{-2}$ s$^{-1}$ in the 2--10 keV band, though it was the earliest X-ray observation of the counterpart.