Resources / MCP Server Risk Directory / MongoDB MCP Server
Is the MongoDB MCP Server safe? Risks, permissions and safe setup
Developers and DBAs using AI assistants to query MongoDB data, inspect schemas and manage Atlas clusters. Here is what an AI agent can do through it, its published vulnerabilities and how to set it up safely.
Baseline risk
- Capabilities: 40 of 40
- Read-plus-exfiltrate: +20
- Hidden instructions (publicly verified): none known
- Third-party publisher: no (official)
Before your own factors: version pinning, number of users and policy coverage. How we score
- Maker
- MongoDB
- Publisher
- Official (published by the maker)
- Runs
- Local or remote
- Transport
- stdio, streamable-http
- Authentication
- Local: MongoDB connection string (MDB_MCP_CONNECTION_STRING) plus optional Atlas API service account client ID/secret for Atlas tools. Remote (Atlas Managed MCP Server, https://mcp.mongodb.com): OAuth client-credentials with an Atlas-provisioned service account, or OAuth via Atlas App Connections in the MongoDB MCP Plugin
- Tools
- 53
- Built-in limits
- --readOnly / MDB_MCP_READ_ONLY (default false, drops create/update/delete tools); --disabledTools by name, operation type or category (atlas, mongodb); confirmationRequiredTools (default includes drop-database, drop-collection, delete-many, atlas-create-db-user, atlas-create-access-list); --indexCheck; remote server read-only flag enabled by default
- License
- Apache-2.0
- Source
- github.com/mongodb-js/mongodb-mcp-server
- Last verified
- 2026-11-23
What an agent can do through it
| Tool | Type | What it does |
|---|---|---|
| find | Read | Queries documents in a collection |
| export | Write | Exports query results to a file on disk |
| update-many | Write | Updates all matching documents |
| delete-many | Delete | Deletes all matching documents |
| drop-database | Delete | Drops an entire database |
| atlas-create-access-list | Infrastructure | Adds IP addresses to an Atlas project access list |
| atlas-create-db-user | Infrastructure | Creates an Atlas database user |
| atlas-create-cluster | Infrastructure | Creates an Atlas cluster |
| aggregate | Read | Runs an aggregation pipeline (asks before $out or $merge) |
Read-plus-exfiltrate: this server can both read sensitive data and send data out, so a single prompt injection in content the agent reads could move private data to an outside party without any other server involved.
Known vulnerabilities
No CVE or security advisory published for this server as of 2026-11-23. Most MCP risk comes from what the tools allow an injected agent to do, so the risks below still apply.
Main risks
Agent opens the cluster to outside access
ASI03 Identity and Privilege Abuse
atlas-create-access-list and atlas-create-db-user can add an attacker IP and a new database user, giving direct external access to all data. A broad Atlas service account (such as Organization Owner) makes this reachable from a single injected instruction.
Prompt injection in stored documents
LLM01:2025 Prompt Injection
Documents returned by find or aggregate go straight into model context, so text in a record can steer the agent to read or modify other collections. Write tools are registered by default because readOnly defaults to false.
Destructive bulk operations
LLM06:2025 Excessive Agency
delete-many, update-many, drop-collection and drop-database can wipe data in one call. Confirmation prompts exist but depend on client elicitation support and can be disabled by emptying confirmationRequiredTools.
Weak isolation in HTTP mode
ASI02 Tool Misuse and Exploitation
The README says the local server has no built-in authentication, is not meant to serve multiple users, and that the mcp-session-id header is client-asserted. Binding beyond loopback requires MDB_MCP_DANGEROUS_HOST_BINDING=true for this reason.
How to set it up safely
- Run with --readOnly (MDB_MCP_READ_ONLY=true) unless writes are required
- Use a database user scoped to the needed databases and collections, not an admin connection string
- Grant the Atlas service account minimum roles, never Organization Owner, or omit Atlas credentials entirely
- Use --disabledTools atlas or disable create/delete operation types when Atlas management is not needed
- Keep the default confirmationRequiredTools list and use a client that supports elicitation
- Pass secrets via environment variables (not CLI arguments), chmod 600 config files, and keep HTTP mode bound to 127.0.0.1
- Pin a reviewed version instead of mongodb-mcp-server@latest, and disable telemetry if required (MDB_MCP_TELEMETRY=disabled)
- For Atlas, prefer the managed remote server with its read-only flag (on by default) and IP access list
How we score
Baseline scores use the method from our guide to scoring every MCP server on employee laptops. Score the servers in your own environment with the free MCP Server Risk Checklist.
1. What the server can do (capped at 40)
- Sends messages externally: 15
- Fetches arbitrary URLs: 15
- Writes to code repositories: 15
- Reads and writes databases: 15
- Writes or deletes local files: 10
- Automates a browser: 10
- Reads and writes SaaS data: 10
- Reads local files: 5
- Runs code or commands: 15 (added for this directory)
- Changes cloud infrastructure: 15 (added for this directory)
- Moves money or changes payments: 15 (added for this directory)
2. What we found
- Read-plus-exfiltrate: reads sensitive data and can also send data out: 20
- Hidden instructions in a tool description (publicly verified): 30, and always Critical
- Third-party: not published by the maker of the system it connects to: 10
3. Band
0–24 Low · 25–49 Medium · 50–74 High · 75–100 Critical.
This is a baseline. The full method also adds points for unpinned package versions, how many employees use the server and whether a policy covers it; those depend on your setup, so check them in your own environment.
How AccuroAI helps
The AccuroAI Endpoint Agent finds the MCP servers configured in AI clients on managed devices and lists the tools each local server exposes. Each server gets a risk level with its capabilities, and you can block a server once in the console to enforce the block on every device: Claude Code and Cursor refuse calls to it, and for other clients the agent stops the server process. Tool calls from coding agents can be graded by risk, then allowed, confirmed with the employee or blocked.
MCP security · MCP server inventory · How to red team an MCP server
Questions about the MongoDB MCP Server
Is the MongoDB MCP Server safe to use?
It can be, with the right setup. At baseline it scores 60 (High) in the AccuroAI method because an agent using it can reads and writes databases, changes cloud infrastructure, writes or deletes local files. Limit its scopes or tools, keep a person in the loop for write actions and pin the version you reviewed.
Does the MongoDB MCP Server have known vulnerabilities?
We found no published CVE or security advisory for it as of 2026-11-23. That does not make it risk-free: most MCP risk comes from what the tools allow an injected agent to do, not from bugs in the server.
How do I restrict the MongoDB MCP Server?
Use the controls the maker provides: --readOnly / MDB_MCP_READ_ONLY (default false, drops create/update/delete tools); --disabledTools by name, operation type or category (atlas, mongodb); confirmationRequiredTools (default includes drop-database, drop-collection, delete-many, atlas-create-db-user, atlas-create-access-list); --indexCheck; remote server read-only flag enabled by default. Then grant the narrowest token or account, approve the server centrally and block other copies of it.
Related servers
PostgreSQL MCP Server (reference) · Supabase MCP Server · All servers
Sources
- https://github.com/mongodb-js/mongodb-mcp-server
- https://www.mongodb.com/docs/mcp-server/overview/
- https://github.com/mongodb-js/mongodb-mcp-server/security/advisories
- https://services.nvd.nist.gov/rest/json/cves/2.0?keywordSearch=mongodb-mcp-server
- https://services.nvd.nist.gov/rest/json/cves/2.0?keywordSearch=MongoDB%20MCP
Facts were verified on 2026-11-23 against the server’s own repository and documentation and public vulnerability records. Servers change often: check the maker’s latest release notes before approving a new version. This page is general security guidance, not a guarantee about any product.