MongoDb-Kafka-Connector error

Did you enable the IP in MongoDB Atlas? See Accessing a MongoDB Atlas cluster in this blog MongoDB Atlas Tutorial | MongoDB.