创建server and agent