This paper addresses the mean square consensus-based formation control for multiple agent system (MAS) with input and output delays under network attacks, process noise, and measurement noise in MAS. Firstly, a time delay-free transformation approach for a multi-agent system with input and output delays is presented. The MAU system is transformed into a formal delay-free discrete-time system using the delay-free transformation method. Then a state observer based on Kalman filter is presented to estimate the states of agents. A distributed predictive consensus protocol based on the estimated states of each MAUS is proposed for the leader-following MAUS. The sufficient and necessary conditions of mean square consensus for MAUS under DoS attacks are derived. Finally, a numerical example of consensus-based formation control for Multi-agent systems is provided to verify the correctness and effectiveness of the proposed consensus control protocol.