MongoDB
Query MongoDB databases and manage Atlas clusters from your agent with read-only mode enabled by default.
Add MongoDB to your agent
Pick your host and paste the config snippet. Replace placeholder tokens and paths before connecting to production data.
1Config location
Global: ~/.cursor/mcp.json or project: .cursor/mcp.json
2Copy this snippet
{
"mcpServers": {
"MongoDB": {
"command": "npx",
"args": ["-y", "mongodb-mcp-server@latest", "--readOnly"],
"env": {
"MDB_MCP_CONNECTION_STRING": "mongodb://localhost:27017/myDatabase"
}
}
}
}
Add this block under mcpServers, then restart Cursor.