This article addresses the consensus problem of linear discrete-time multiagent systems (MASs) under the conditions of input constraints and bounded time-varying communication delays. We propose a novel consensus framework for such constrained MASs that incorporates an offline optimal consensus design for unconstrained systems to achieve optimal consensus convergence, along with an online robust distributed model predictive control (DMPC) to accommodate constraints. Our framework accomplishes near-optimal consensus performance by minimizing the divergence between the online DMPC input and the predesigned optimal consensus input, all while adhering to control input constraints. Notably, we explicitly integrate the knowledge of communication topology into the offline consensus protocol design, thereby enhancing the analysis of consensus convergence in MASs. More specifically, each agent is equipped with an offline consensus protocol based on the estimated states of its immediate neighbors. Furthermore, we demonstrate that estimation errors propagated over time due to imprecise neighboring information remain bounded under mild assumptions. In addition, we confirm that, with the appropriate design of the cost function and constraints, the feasibility of the related optimization problem can be recursively assured. We also provide a consensus convergence result for the constrained MASs under conditions of bounded varying delays. Lastly, we present two numerical examples that verify the effectiveness of the proposed distributed consensus algorithm.