Official MongoDB server covering data, schemas and Atlas management — from find queries to spinning up clusters.
MongoDB's official MCP server covers two jobs that usually need two different tools: working with data (find, aggregate, count, insert, update across any MongoDB deployment) and working with Atlas infrastructure (creating clusters, managing database users, configuring network access) when you connect it with Atlas API credentials.
The data side is what most people come for. Document databases are famously easy to write to and famously annoying to explore — six years of organic schema drift means nobody quite knows what shape orders documents have anymore. The server's schema tools answer that empirically, sampling collections to describe the fields that actually exist. From there, natural-language questions become aggregation pipelines: "monthly revenue by product category from the orders collection" is exactly the kind of query where an assistant writing the pipeline beats you looking up $group syntax for the fourth time.
The Atlas management side is rarer among database MCP servers and genuinely handy for teams living in Atlas: provisioning a dev cluster, rotating a database user, or checking why an IP can't connect happens in the same conversation as the data work.
Configuration deserves attention: flags like --readOnly exist and you should use them by default, only removing restrictions when a task genuinely needs writes. Between connection-string access to any MongoDB (including self-hosted and Community Edition) and API-key access to Atlas, treat scoping as part of setup, not an afterthought.
collection-schema on the collections you care about. It samples real documents rather than reading a declared schema, which is how you find the optional fields and mixed types that quietly break queries written from assumptions.--indexCheck) to refuse find and aggregate operations that would trigger a full collection scan — a useful seatbelt when the connection string points somewhere production-sized.--disabledTools; fewer tools in context measurably improves which one it reaches for on an ambiguous request.Sample real documents to learn what fields actually exist before writing queries against assumptions.
Describe the report you want; the assistant writes and runs the pipeline.
Provision dev clusters, rotate users and fix network access without opening the Atlas console.
| Tool | What it does |
|---|---|
| find | Query documents in a collection with filters and projections |
| aggregate | Run aggregation pipelines |
| count | Count documents matching a filter |
| collection-schema | Infer a collection's schema from sampled documents |
| list-databases / list-collections | Enumerate what exists on the deployment |
| insert-many / update-many / delete-many | Write operations (disabled under --readOnly) |
| collection-indexes | Inspect indexes on a collection |
| atlas-* tools | Create clusters, manage users and network access (with Atlas credentials) |
{
"mcpServers": {
"mongodb": {
"command": "npx",
"args": ["-y", "mongodb-mcp-server",
"--connectionString", "mongodb+srv://user:pass@cluster.mongodb.net/mydb",
"--readOnly"]
}
}
}Drop --readOnly only when you actually need writes.
Node.js 20+. A MongoDB connection string, or Atlas service-account credentials for cluster management.
| Variable | Description | Required |
|---|---|---|
| MDB_MCP_CONNECTION_STRING | Connection string alternative to the CLI flage.g. mongodb+srv://user:pass@cluster.mongodb.net/mydb | Optional |
| MDB_MCP_API_CLIENT_ID | Atlas service-account client ID (enables Atlas management tools) | Optional |
| MDB_MCP_API_CLIENT_SECRET | Atlas service-account client secret | Optional |
Read-only SQL access to Postgres — let your assistant inspect schemas and answer questions from real data.
Manage your whole Supabase project in conversation — database, auth, storage, Edge Functions and branches.
Query, modify and analyse local SQLite databases in conversation — the fastest way to chat with a data file.
Metabase ships its own MCP endpoint — search your BI content, build and run queries, and save questions and dashboards without leaving the chat.
Serverless Postgres with database branching — point your assistant at Neon and let it work on disposable copies.
Official Redis server — search keys, inspect data structures and manage caches in natural language.