AUTOMATIONSWITCH
VendorDatabase

MongoDB MCP Server

by MongoDB Inc.

Vendor-built MongoDB MCP server covering both direct database operations (against any MongoDB connection string) and MongoDB Atlas API operations (via Service Accounts credentials). Ships with --readOnly enabled by default in every official install snippet.

1,011·8 tools·Released APR 2025·Apache-2.0
npx -y mongodb-mcp-server@latest --readOnly
Share:

The MongoDB MCP server is the cleanest example of "vendor takes safety seriously" in the database category. Every install snippet in the README ships with --readOnly set, including the one-click installers for VS Code and Cursor. Removing the flag is an explicit choice the operator has to make. The server covers two distinct surfaces: direct database operations against any MongoDB connection (including local clusters and self-hosted), and Atlas API operations against MongoDB's hosted service via Service Accounts credentials. The combination means one server config handles both the "let the agent query my data" use case and the "let the agent provision a cluster" use case, with Atlas IAM as the boundary for the latter. The trade-off is the operator carries the responsibility for connection-string hygiene; the README warns explicitly against passing secrets via command-line arguments and recommends environment variables.

Reviewed by M. Nouriel · APR 2026

INSTALL THIS SERVER

Requires authenticationMongoDB connection string via MDB_MCP_CONNECTION_STRING, OR Atlas Service Accounts via MDB_MCP_API_CLIENT_ID + MDB_MCP_API_CLIENT_SECRET
{ "mcpServers": { "MongoDB": { "command": "npx", "args": [ "-y", "mongodb-mcp-server@latest", "--readOnly" ], "env": { "MDB_MCP_CONNECTION_STRING": "mongodb://localhost:27017/myDatabase" } } } }
PrereqRequires Node.js 20.19.0+ (or 22.12.0+). Set MDB_MCP_CONNECTION_STRING to your MongoDB connection string, OR use Atlas Service Accounts (MDB_MCP_API_CLIENT_ID + MDB_MCP_API_CLIENT_SECRET). Path: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS).
{ "mcpServers": { "MongoDB": { "command": "npx", "args": [ "-y", "mongodb-mcp-server@latest", "--readOnly" ], "env": { "MDB_MCP_CONNECTION_STRING": "mongodb://localhost:27017/myDatabase" } } } }
{ "mcpServers": { "MongoDB": { "command": "npx", "args": [ "-y", "mongodb-mcp-server@latest", "--readOnly" ], "env": { "MDB_MCP_CONNECTION_STRING": "mongodb://localhost:27017/myDatabase" } } } }
{ "mcpServers": { "MongoDB": { "command": "npx", "args": [ "-y", "mongodb-mcp-server@latest", "--readOnly" ], "env": { "MDB_MCP_CONNECTION_STRING": "mongodb://localhost:27017/myDatabase" } } } }
{ "mcpServers": { "MongoDB": { "command": "npx", "args": [ "-y", "mongodb-mcp-server@latest", "--readOnly" ], "env": { "MDB_MCP_CONNECTION_STRING": "mongodb://localhost:27017/myDatabase" } } } }

8 TOOLS AVAILABLE

find
Run a find query against a MongoDB collection
Read
aggregate
Execute aggregation pipelines
Read
list_collections
List collections in the connected database
Read
list_indexes
List indexes on a collection
Read
get_schema
Infer schema from collection samples
Read
create_cluster
Provision an Atlas cluster (write mode required)
Admin

OUR ASSESSMENT

Strengths
  • Ships with `--readOnly` enabled in every official install snippet; write mode requires explicit operator opt-in.
  • Two surfaces in one server: database operations against a connection string, plus Atlas API operations via Service Accounts.
  • Environment-variable-first credential handling, with the README explicitly warning against command-line secrets.
  • Vendor-maintained; the same team that builds MongoDB Atlas keeps the server current.
Weaknesses
  • Atlas API features require Service Accounts credentials with carefully scoped permissions; the README points to a separate Atlas API Permissions section that operators need to read.
  • Connection-string security depends on the operator; misconfigured environment variables expose the cluster.
  • Node.js version requirements are tight (20.19.0+ or 22.12.0+); older runtimes fail silently.
Security Notes

The default `--readOnly` flag restricts the server to read operations across collections, indexes, and Atlas resources. Removing the flag is an explicit operator choice and surfaces in the install command. Connection strings and Atlas API credentials pass via environment variables (MDB_MCP_CONNECTION_STRING, MDB_MCP_API_CLIENT_ID, MDB_MCP_API_CLIENT_SECRET); the README warns against command-line argument passing because of process-list and log exposure. For Atlas, MongoDB recommends scoping Service Accounts to the minimum required Atlas API Permissions and rotating credentials regularly.

Best For

Teams running MongoDB Atlas or self-hosted MongoDB clusters who want an agent that can read data, manage Atlas resources, and stay safe by default.

TECHNICAL DETAILS

Language
typescript
Transport
stdio
Clients
Claude DesktopClaude CodeCursorVS CodeWindsurf
License
Apache-2.0
npm
mongodb-mcp-server
Last Release
v1.10.0APR 22, 2026
First Released
APR 15, 2025

ADOPTION METRICS

// GitHub Stars
1,011

// Reading this1k stars in under twelve months reflects MongoDB's vendor-stewardship of the server. Star traction tracks alongside MongoDB Atlas adoption among AI-first teams.

// Popularity Rank
#14
Globally · #5 in Database

// Reading thisTop-5 database MCP for vendor-built tooling. The --readOnly default and Atlas API coverage put it ahead of community alternatives.

SOURCES & VERIFICATION

We don't take any single directory's word for it. Before scoring, we cross-reference 5 public MCP sources, install the server ourselves against the clients we cover, and record when we last re-verified.

01
Discovered
Manual submission
First indexed APR 28, 2026
02
Cross-referenced
5 directories
PulseMCP, Official MCP Registry, Awesome MCP Servers, Smithery, MCP.so
03
Verified against
Claude Desktop, Cursor, VS Code, Windsurf
Installed and tested across clients
04
Last re-checked
APR 28, 2026
Weekly re-verification
// How other directories see it

The same server, 5 different lenses. We reconcile these signals into our editorial score, which is why our number sometimes diverges from a directory-aggregate star count.

SourceTheir ratingTheir star countTheir downloadsLast synced
AutomationSwitch This page4editorial1,011APR 28, 2026
PulseMCP— unratedunavailableunavailableAPR 28, 2026
Official MCP Registry— unratedunavailableunavailableAPR 28, 2026
Awesome MCP Servers— unratedunavailableunavailableAPR 28, 2026
Smithery— unratedunavailableunavailableAPR 28, 2026
MCP.so— unratedunavailableunavailableAPR 28, 2026

// Counts are directory-reported; we don't adjust them. Discrepancies usually come from different snapshot times or star-caching.

// Get in touch

DISCUSS YOUR
MCP REQUIREMENTS.

Evaluating a server, scoping an internal deployment, or working out whether MCP is the right fit at all. Start the conversation and we will point you at the right piece of the ecosystem.

Discuss Your MCP Requirements →