
MongoDB MCP
Query, aggregate and inspect MongoDB and Atlas clusters from your AI agent
About
The MongoDB MCP Server is the official Model Context Protocol server for interacting with MongoDB databases and MongoDB Atlas clusters. It provides database tools for queries, aggregations and schema discovery, plus Atlas tools for cluster management. It is best for developers who want their agent to explore and work with MongoDB data directly.
npx -y mongodb-mcp-server@latest setup
# Manual configuration — Option 1: Connection String
{
"mcpServers": {
"MongoDB": {
"command": "npx",
"args": ["-y", "mongodb-mcp-server@latest", "--readOnly"],
"env": {
"MDB_MCP_CONNECTION_STRING": "mongodb://localhost:27017/myDatabase"
}
}
}
}Copy individual commands
npx -y mongodb-mcp-server@latest setup- Manual configuration — Option 1: Connection String:
{ "mcpServers": {"MongoDB": {"command": "npx","args": ["-y", "mongodb-mcp-server@latest", "--readOnly"],"env": {"MDB_MCP_CONNECTION_STRING": "mongodb://localhost:27017/myDatabase"}}}}
Prerequisites: Node.js at least v22.13.0 and a MongoDB connection string or Atlas API credentials. Examples include --readOnly by default for safe read-only access; remove it to enable writes.
More in MCP Servers
View allContext7
Up-to-date, version-specific library docs pulled straight into your prompt.
Playwright MCP
Let your AI drive a real browser — navigate, click, fill forms and read pages.
Docker MCP Gateway
Run MCP servers as isolated Docker containers from the signed catalog, behind one gateway endpoint. Needs Docker.