B

MongoDB MCP Server

Official MongoDB MCP server for database operations, Atlas cloud management, local deployments, and knowledge base access

Overall Score70/100

Score Breakdown

Server Info

Package
mongodb-mcp-server
Registry
npm
Maintainer
MongoDBVendor
Category
Developer Tools
Tags
nosqldatabasemongodb
Last Scanned
7 Apr 2026

Findings

7 issues

Authentication & Identity

MEDIUMHTTP/SSE transport supports per-request credentials

Supports both stdio and StreamableHTTP transports. MongoDB connection string passed via MDB_MCP_CONNECTION_STRING env var or CLI argument. Atlas API auth via OAuth client credentials (MDB_MCP_API_CLIENT_ID/SECRET). No MCP OAuth spec implementation. Config also supports MDB_MCP_ prefix for all settings.

Remediation

Implement the MCP OAuth spec so users authenticate directly without platform mediation.

Tool Schema Quality

HIGHRequired fields missing on 2 write operations

Write tools without required field declarations: switch-connection, atlas-local-create-deployment.

Remediation

Add required arrays to all write/delete tool schemas.

MEDIUMOnly 6 of 46 schemas have parameter constraints

Most schemas lack maxLength, enum, or pattern constraints on string parameters.

Remediation

Add constraints to string parameters, especially on write operations.

CRITICALDangerous execution surface: aggregate tool allows $out/$merge stages which can write data, though this is blocked in readOnly mode

Tool allows raw code/query execution which could be exploited via prompt injection.

Remediation

Use parameterized queries or validated command sets.

Permission Granularity

MEDIUM1 tools combine read and write operations

Excellent permission granularity. Tools are separated by operationType (metadata/read/create/update/delete/connect) and category (mongodb/atlas/atlas-local/assistant). Config supports readOnly mode, disabledTools list (by name, category, or operation type), and confirmationRequiredTools for destructive operations. The aggregate tool is the only mixed read/write tool as it can execute $out/$merge stages. Tool annotations include readOnlyHint and destructiveHint.

Remediation

Split into separate read and write tools.

LLM Safety

HIGHTool descriptions contain instructional language

Descriptions include directives that could influence LLM behavior beyond tool selection.

Remediation

Remove instructional language. Descriptions should be purely factual.

Data Exposure

MEDIUM5 list operations lack pagination

Find tool supports projection (field selection), limit with configurable defaults (10 docs), and responseBytesLimit (1MB default). Aggregate tool has configurable maxDocumentsPerQuery and maxBytesPerQuery limits. Export tool provides full result export to resources. Atlas list operations use hardcoded itemsPerPage=500 without pagination controls. List-databases and list-collections return all results without pagination.

Remediation

Add limit/offset or cursor-based pagination.

Tools

46 total
NameDescriptionRisk
connectConnect to a MongoDB instance. The config resource captures if the server is already connected to a MongoDB cluster. If the user has configured a connection string or has previously called the connect tool, a connection is already established and there's no need to call this tool unless the user has explicitly requested to switch to a new MongoDB cluster.write
switch-connectionSwitch to a different MongoDB connection. If the user has configured a connection string or has previously called the connect tool, a connection is already established and there's no need to call this tool unless the user has explicitly requested to switch to a new instance.write
list-databasesList all databases for a MongoDB connectionread
list-collectionsList all collections for a given databaseread
collection-indexesDescribe the indexes for a collectionread
collection-schemaDescribe the schema for a collectionread
collection-storage-sizeGets the size of the collectionread
db-statsReturns statistics that reflect the use state of a single databaseread
mongodb-logsReturns the most recent logged mongod eventsread
explainReturns statistics describing the execution of the winning plan chosen by the query optimizer for the evaluated methodread
findRun a find query against a MongoDB collectionread
countGets the number of documents in a MongoDB collection using db.collection.count() and query as an optional filter parameterread
aggregateRun an aggregation against a MongoDB collectionread
exportExport a query or aggregation results in the specified EJSON format.read
insert-manyInsert an array of documents into a MongoDB collection. If the list of documents is above com.mongodb/maxRequestPayloadBytes, consider inserting them in batches.write
create-indexCreate an index for a collectionwrite
create-collectionCreates a new collection in a database. If the database doesn't exist, it will be created automatically.write
update-manyUpdates all documents that match the specified filter for a collection. If the list of documents is above com.mongodb/maxRequestPayloadBytes, consider updating them in batches.write
rename-collectionRenames a collection in a MongoDB databasewrite
delete-manyRemoves all documents that match the filter from a MongoDB collectionadmin
drop-collectionRemoves a collection or view from the database. The method also removes any indexes associated with the dropped collection.admin
drop-databaseRemoves the specified database, deleting the associated data filesadmin
drop-indexDrop an index for the provided database and collection.admin
atlas-list-orgsList MongoDB Atlas organizationsread
atlas-list-projectsList MongoDB Atlas projectsread
atlas-list-clustersList MongoDB Atlas clustersread
atlas-inspect-clusterInspect metadata of a MongoDB Atlas clusterread
atlas-inspect-access-listInspect Ip/CIDR ranges with access to your MongoDB Atlas clusters.read
atlas-list-db-usersList MongoDB Atlas database usersread
atlas-list-alertsList MongoDB Atlas alertsread
atlas-get-performance-advisorGet MongoDB Atlas performance advisor recommendations and suggestionsread
atlas-connect-clusterConnect to MongoDB Atlas clusterwrite
atlas-create-free-clusterCreate a free MongoDB Atlas clusterwrite
atlas-create-access-listAllow Ip/CIDR ranges to access your MongoDB Atlas clusters.write
atlas-create-db-userCreate an MongoDB Atlas database useradmin
atlas-create-projectCreate a MongoDB Atlas projectwrite
atlas-streams-discoverDiscover Atlas Stream Processing resourcesread
atlas-streams-buildBuild Atlas Stream Processing pipelineswrite
atlas-streams-manageManage Atlas Stream Processing pipelineswrite
atlas-streams-teardownTeardown Atlas Stream Processing resourcesadmin
atlas-local-list-deploymentsList MongoDB Atlas local deploymentsread
atlas-local-create-deploymentCreate a MongoDB Atlas local deploymentwrite
atlas-local-connect-deploymentConnect to a MongoDB Atlas Local deploymentwrite
atlas-local-delete-deploymentDelete a MongoDB Atlas local deploymentadmin
search-knowledgeSearch for information in the MongoDB Assistant knowledge base. This includes official documentation, curated expert guidance, and other resources provided by MongoDB. Supports filtering by data source and version.read
list-knowledge-sourcesList available data sources in the MongoDB Assistant knowledge base. Use this to explore available data sources or to find search filter parameters to use in search-knowledge.read

Deploy MongoDB MCP Server securely

CompleteFlow adds per-user authentication, permission scoping, and audit logging to any MCP server out of the box.

Deploy on CompleteFlow