Unable to connect to MongoDB from VS Code

The error message is probably correct.
Probably you have not configured your Atlas instance to allow connections. See Configure IP Access List Entries - Atlas - MongoDB Docs
If you’re trying to connect to Atlas, connecting to localhost at 127.0.0.1 certainly is no help.

1 Like