MongoDB MCP Server
MongoDB's official MCP server for querying databases and managing Atlas clusters from AI agents.
Sources and review
Checked against public documentation on . Suitability guidance is our editorial judgment; this is not a performance benchmark or an endorsement.
Exploring collections, writing queries and managing Atlas from an AI coding assistant.
About MongoDB MCP Server
MongoDB's official MCP server connects AI agents to MongoDB databases and MongoDB Atlas. It runs locally against any self-managed deployment, optionally in read-only mode, and ships in official MongoDB plugins for Cursor, VS Code, Claude, Codex and GitHub Copilot CLI; MongoDB recommends its hosted Atlas MCP server over OAuth for Atlas users.
MongoDB MCP Server is an open-source project written primarily in TypeScript, with 1.1k stars on GitHub. It was last updated in September 2026.
Add MongoDB MCP Server to your MCP client
Generated from the launch command in the project's README. Your client starts the server on demand.
Claude Code
claude mcp add mongodb-mcp-server -e MDB_MCP_CONNECTION_STRING=mongodb://localhost:27017/myDatabase -- npx -y mongodb-mcp-server@latest --readOnlyCursor
{
"mcpServers": {
"mongodb-mcp-server": {
"command": "npx",
"args": ["-y", "mongodb-mcp-server@latest", "--readOnly"],
"env": {
"MDB_MCP_CONNECTION_STRING": "mongodb://localhost:27017/myDatabase"
}
}
}
}VS Code
{
"servers": {
"mongodb-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "mongodb-mcp-server@latest", "--readOnly"],
"env": {
"MDB_MCP_CONNECTION_STRING": "mongodb://localhost:27017/myDatabase"
}
}
}
}Claude Desktop
{
"mcpServers": {
"mongodb-mcp-server": {
"command": "npx",
"args": ["-y", "mongodb-mcp-server@latest", "--readOnly"],
"env": {
"MDB_MCP_CONNECTION_STRING": "mongodb://localhost:27017/myDatabase"
}
}
}
}Codex
[mcp_servers.mongodb-mcp-server]
command = "npx"
args = ["-y", "mongodb-mcp-server@latest", "--readOnly"]
env = { MDB_MCP_CONNECTION_STRING = "mongodb://localhost:27017/myDatabase" }MongoDB MCP Server vs. the alternatives
All 163 alternatives →| Record | Stars | Pricing | ||
|---|---|---|---|---|
| MongoDB MCP Serverthis listing | 1.1k | TypeScript | Apache-2.0 | Open source |
| MCP Reference Servers | 91k | TypeScript | MIT AND Apache-2.0 | Open source |
| context7 | 62k | TypeScript | MIT | Open source |
| chrome-devtools-mcp | 53k | TypeScript | Apache-2.0 | Open source |
| Playwright MCP | 37k | TypeScript | Apache-2.0 | Open source |
| github-mcp-server | 33k | Go | MIT | Open source |
