Applying dynamic web services composition is one of the important schemas for solving service-oriented architecture (SOA)and service-oriented computing(SOC).For implementing dynamic web services composition,the multi agent system (MAS)is applied to web services composition.First, the essentials of the MAS and web services composition are analyzed and their relationship is discussed.Secondly, an MAS-based architecture is designed for dynamic web services composition,and it is named as CSMWC.A Jade tool is used to implement the major components.The architecture can primarily implement syntactic level dynamic web services composition,and it gives a basis for semantic level dynamic web services composition.For specifying the correctness of the architecture,by using pi-calculus,the architecture of the MAS is formally described,and its dynamic properties and adaptability are reasoned.Finally,it demonstrates the idea proposed by the Pi4SOA tool.