MongoDB Atlas Managed MCP Server
OFFICIAL SERVERMongoDB's hosted MCP endpoint for querying Atlas clusters and administering Atlas projects
Query and manage MongoDB databases and MongoDB Atlas clusters, projects and users from an assistant
Official · mongodb-js TypeScript Local · stdio DatabasesCloud platforms
93 popularity score ★ 1.2k ↓ 157k/wk
Opens the app, which asks before it adds the server.
claude mcp add mongodb -- npx -y mongodb-mcp-server@latest --readOnly{
"mcpServers": {
"mongodb": {
"command": "npx",
"args": [
"-y",
"mongodb-mcp-server@latest",
"--readOnly"
]
}
}
}{
"mcpServers": {
"mongodb": {
"command": "npx",
"args": [
"-y",
"mongodb-mcp-server@latest",
"--readOnly"
]
}
}
}{
"servers": {
"mongodb": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mongodb-mcp-server@latest",
"--readOnly"
]
}
}
}[mcp_servers.mongodb]
command = "npx"
args = ["-y", "mongodb-mcp-server@latest", "--readOnly"]gemini mcp add --scope user mongodb npx -- -y mongodb-mcp-server@latest --readOnlyOpens the app, which asks before it adds the server.
claude mcp add mongodb -- docker run --rm -i mongodb/mongodb-mcp-server:latest{
"mcpServers": {
"mongodb": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"mongodb/mongodb-mcp-server:latest"
]
}
}
}{
"mcpServers": {
"mongodb": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"mongodb/mongodb-mcp-server:latest"
]
}
}
}{
"servers": {
"mongodb": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"mongodb/mongodb-mcp-server:latest"
]
}
}
}[mcp_servers.mongodb]
command = "docker"
args = ["run", "--rm", "-i", "mongodb/mongodb-mcp-server:latest"]gemini mcp add --scope user mongodb docker -- run --rm -i mongodb/mongodb-mcp-server:latestMDB_MCP_CONNECTION_STRING secret |
Optional: Deprecated single connection string, used as the preconfigured connection. MDB_MCP_CONNECTION_STRINGS, a JSON object of named strings, replaces it. With neither set the assistant must call connect first. |
|---|---|
| Set together: atlas | |
MDB_MCP_API_CLIENT_ID |
Optional: Atlas service account client ID, needed for the atlas- tools. |
MDB_MCP_API_CLIENT_SECRET secret |
Optional: Atlas service account client secret, paired with the client ID. |
In a container, a setting goes in with -e NAME=value after docker run.
This is MongoDB's own server for working with MongoDB from an assistant. Point it at a deployment with a connection string, or have the assistant call connect later, and it can browse databases and run find queries or aggregation pipelines. It will also infer a collection's schema, show indexes and explain plans, or export results to EJSON files. Writes are on by default too, down to dropping whole databases. Any MongoDB deployment works, self-hosted or on Atlas.
Give it an Atlas service account (client ID and secret) and a second set of tools turns on for Atlas itself. Those cover clusters (create, inspect, pause, upgrade), database users and IP access lists. You also get Performance Advisor output, alerts, and setting up or tearing down Stream Processing. There are also tools for Atlas Local deployments running in Docker and a search over MongoDB's Assistant knowledge base.
Out of the box the find tool hands back 10 documents per call. The server caps find and aggregate at 100 documents and 16 MB per call, and a single find reply at 1 MB unless the assistant asks for more (find.ts and the config schema). It ships 53 tools in all.
A few settings have new names. The single connection string is giving way to MDB_MCP_CONNECTION_STRINGS, a JSON object of named strings where each name turns into a connectionId the tools can use, so one server can talk to several deployments. The old string now just fills the entry called preconfigured, and the config schema rejects setting both. The timeouts moved as well: maxTimeMS is now timeoutMs, and the two count caps are queryCountTimeoutMs and aggregationCountTimeoutMs. The old names still work for now but are deprecated.
| Runtime | Node.js 20.19+ |
|---|---|
| Runs on | macOS, Windows, Linux |
| MongoDB | Your own instanceAny reachable deployment. The Atlas tools need an Atlas service account with API credentials. |
Node 22.13 or later is what the README asks for. The package still accepts Node 20.19, but Node 20 support is deprecated and due to be dropped. The Docker image needs no local Node. For the Atlas tools, create a service account in Atlas, give it only the permissions you need, and pass its client ID and secret as environment variables. Other settings use the MDB_MCP_ prefix with the option name in upper snake case, for example MDB_MCP_READ_ONLY=true, MDB_MCP_TELEMETRY=disabled or MDB_MCP_AGGREGATION_COUNT_TIMEOUT_MS (60000 ms by default).
A good fit for developers who want an assistant to explore, query or tidy up a MongoDB database they already run, local or on Atlas, and for Atlas users who want cluster, user and access list chores handled from the same place. Because it runs on your own machine with your own credentials, it suits one person at a time. For shared or multi-user Atlas access, MongoDB points to its Atlas-Managed MCP server, a hosted endpoint at mcp.mongodb.com that handles sign-in per user. If you only need to read data, start it with --readOnly as the README's examples do.
30 only read, 17 change things, 6 can delete or overwrite. A ? marks an optional parameter.
aggregateaggregate-dbcollection-indexescollection-schemacollection-storage-sizeconnectcountcreate-collection changescreate-index changesdb-statsdelete-many deletesdisconnectdrop-collection deletesdrop-database deletesdrop-index deletesexplainexport changesfinddatabase: stringcollection: stringfilter?: objectprojection?: objectlimit?: numbersort?: objectresponseBytesLimit?: numberinsert-many changeslist-collectionslist-connectionslist-databasesmongodb-logsrename-collection changesupdate-many changesatlas-connect-clusteratlas-create-access-list changesatlas-create-cluster changesatlas-create-db-user changesatlas-create-free-cluster changesatlas-create-project changesatlas-get-performance-advisoratlas-get-regionsatlas-inspect-access-listatlas-inspect-clusteratlas-list-alertsatlas-list-clustersatlas-list-db-usersatlas-list-orgsatlas-list-projectsatlas-load-sample-dataset changesatlas-pause-resume-cluster changesatlas-streams-build changesatlas-streams-discoveratlas-streams-manage changesatlas-streams-teardown deletesatlas-upgrade-cluster changesatlas-local-connect-deploymentatlas-local-create-deployment changesatlas-local-delete-deployment deletesatlas-local-list-deploymentslist-knowledge-sourcessearch-knowledgeconfig://configdebug://mongodbexported-data://{exportName}