MongoDB MCP Server
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.
“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.”
INSTALL THIS SERVER
{
"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"
}
}
}
}
{
"mcpServers": {
"MongoDB": {
"command": "npx",
"args": [
"-y",
"mongodb-mcp-server@latest",
"--readOnly"
],
"env": {
"MDB_MCP_CONNECTION_STRING": "mongodb://localhost:27017/myDatabase"
}
}
}
}
8 TOOLS AVAILABLE
OUR ASSESSMENT
- 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.
- 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.
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.
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
ADOPTION METRICS
// 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.
// 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.
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.
| Source | Their rating | Their star count | Their downloads | Last synced |
|---|---|---|---|---|
| AutomationSwitch This page | 4editorial | 1,011 | — | APR 28, 2026 |
| PulseMCP | — unrated | unavailable | unavailable | APR 28, 2026 |
| Official MCP Registry | — unrated | unavailable | unavailable | APR 28, 2026 |
| Awesome MCP Servers | — unrated | unavailable | unavailable | APR 28, 2026 |
| Smithery | — unrated | unavailable | unavailable | APR 28, 2026 |
| MCP.so | — unrated | unavailable | unavailable | APR 28, 2026 |
// Counts are directory-reported; we don't adjust them. Discrepancies usually come from different snapshot times or star-caching.
OTHER DATABASE MCP SERVERS
Postgres MCP
Official MCP server for PostgreSQL. Provides read and write access to PostgreSQL databases with schema introspection, query execution, and transaction support. The reference implementation for database MCP servers.
Supabase
Persistence layer with full Postgres access and Row Level Security awareness. Query tables, manage schemas, handle auth users, and work with storage buckets.
MCP Toolbox for Databases
Google's open-source MCP server for databases. One MCP binary speaks PostgreSQL, MySQL, BigQuery, Spanner, AlloyDB, Cloud SQL, and SQLite. 14,937 GitHub stars and 100 commits on main in the last 30 days. Highest commit cadence in the directory.
ClickHouse MCP
Official ClickHouse MCP server with both ClickHouse Tools (production cluster queries) and chDB Tools (embedded ClickHouse for local analytics). Apache-2.0 with destructive-operation protection: write access is opt-in via configuration.
Redis MCP
Official Redis MCP server with natural-language interface for managing and searching Redis data. EntraID authentication for Azure Managed Redis included; Redis ACL configurable via environment variables. Tool coverage spans strings, lists, hashes, sets, sorted sets, JSON, vectors, and search.
Elasticsearch MCP
Elasticsearch and OpenSearch MCP server with index management, document CRUD, search queries, cluster health, and aggregations. 270 stars and 22 commits on main in the last 30 days.
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.