MongoDB MCP
About This Server
MongoDB's official MCP server lets AI agents connect to MongoDB databases and Atlas clusters in natural language — query/write documents, manage collections and indexes, inspect cluster status, with a read-only mode to protect production data.
Installation
npx -y mongodb-mcp-serverFrequently Asked Questions
Does MongoDB MCP support Atlas cloud and self-hosted instances?
Both. It connects to self-hosted instances or replica sets via a standard MongoDB connection string, and also to MongoDB Atlas cloud clusters; for Atlas it adds cluster/project management tools so agents can inspect and operate cloud resources.
How do I stop an agent from accidentally modifying production data?
Start it with the --readOnly flag to enable read-only mode, which blocks all writes and allows only queries; pairing that with a read-scoped database user gives double protection so the AI can safely analyze a production database without changing data.
Is MongoDB MCP free?
The MCP server is officially open-sourced by MongoDB and free (Apache-2.0); it connects to your own database or Atlas cluster. MongoDB Community and the Atlas free tier cost nothing, and only paid Atlas clusters incur cloud charges.