The optimal nonholonomic motion planning for spacecraft multibody system is researched. The attitude motion equations of spacecraft multibody system take on nonholonomic constraint without outside force. The control of system can be converted to the nonholonomic motion planning problem for a driftless system. Based on modified-Newton method, the optimal control algorithm of controlling spacecraft to desired attitude is accepted by optimal control algorithm and Ritz approximation theory. Quaternion is used to describe the kinematics equation, which avoids the singularity and has the benefit of small calculation and high precision. At last, numerical simulations of spacecraft with two reaction fly wheels has proved of the approach to be effective.