MongoDB MCP — Auth Setup
MongoDB Atlas uses a connection string to authenticate and route database requests.
1. Get your credentials
- Open MongoDB Atlas and select your project (opens MongoDB — we never see your credentials)
- Navigate to Database > Connect for your cluster
- Choose Connect your application and copy the full connection string
- 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).

