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.
MindsDB
A federated query engine that exposes 200+ data sources as MCP tools through a unified SQL-compatible interface. Built around a Connect → Unify → Respond workflow with structured tables fused with vectorized data inside Knowledge Bases.
Neon MCP
MCP server for Neon serverless Postgres. Provides database branching, query execution, and project management. Branch-per-query makes every schema change reversible.
Neo4j MCP (Labs)
Four Neo4j MCP servers maintained by the Neo4j Field GenAI team as part of Neo4j Labs: cypher (natural-language-to-Cypher with schema introspection), memory (knowledge-graph memory across agent sessions), cloud-aura-api (Aura cloud instance management), and data-modeling (graph data modelling and visualization). Each is a separate installable PyPI package.
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.