Skip to content
skillsaggregatorskillsaggregator
Privacy: This guide links directly to MongoDB's credential pages. We never ask you to enter, store, or transmit any credential through this site. Zero outbound calls to anything but the vendor's docs.

MongoDB MCP — Auth Setup

MongoDB Atlas uses a connection string to authenticate and route database requests.

1. Get your credentials

  1. Open MongoDB Atlas and select your project (opens MongoDB — we never see your credentials)
  2. Navigate to Database > Connect for your cluster
  3. Choose Connect your application and copy the full connection string
  4. Replace <username> and <password> in the string with your database user credentials

2. Set environment variables

macOS / Linux — add to ~/.zshrc or ~/.bashrc:

export MONGODB_CONNECTION_STRING=YOUR_CONNECTION_STRING_HERE

Then run source ~/.zshrc (or open a new terminal).

Windows — run in Command Prompt (then restart):

setx MONGODB_CONNECTION_STRING "YOUR_CONNECTION_STRING_HERE"

3. Verify

npx claude-skills doctor

You should see ✅ next to the MongoDB MCP entry. If you see ❌, confirm the variable is set: echo $MONGODB_CONNECTION_STRING.

4. Restart Claude Code

Quit and reopen Claude Code (or run /mcp list inside Claude Code to confirm the MongoDB MCP appears).