
The MongoDB MCP Server provides LLM-based access to MongoDB databases by exposing tools for querying, inserting, updating, and deleting documents through the Model Context Protocol. It enables AI assistants to interact with MongoDB instances by accepting a connection string and offering read-only or read-write operations depending on configuration. This server solves the problem of integrating database operations into AI workflows by allowing language models to perform structured data manipulation without direct code execution.
Public tool metadata for what this MCP can expose to an agent.
aggregateRun an aggregation against a MongoDB collectionRun an aggregation against a MongoDB collection
No parameter schema in public metadata yet.
aggregate-dbRun an aggregation against a MongoDB databaseRun an aggregation against a MongoDB database
No parameter schema in public metadata yet.
collection-indexesDescribe the indexes for a collectionDescribe the indexes for a collection
No parameter schema in public metadata yet.
collection-schemaDescribe the schema for a collectionDescribe the schema for a collection
No parameter schema in public metadata yet.
collection-storage-sizeGets the size of the collectionGets the size of the collection
No parameter schema in public metadata yet.
connectConnect to a MongoDB instanceConnect to a MongoDB instance
No parameter schema in public metadata yet.
countGets the number of documents in a MongoDB collection using db.collection.count() and query as an optional filter parameterGets the number of documents in a MongoDB collection using db.collection.count() and query as an optional filter parameter
No parameter schema in public metadata yet.
create-collectionCreates a new collection in a database. If the database doesn't exist, it will be created automatically.Creates a new collection in a database. If the database doesn't exist, it will be created automatically.
No parameter schema in public metadata yet.
create-indexCreate an index for a collectionCreate an index for a collection
No parameter schema in public metadata yet.
db-statsReturns statistics that reflect the use state of a single databaseReturns statistics that reflect the use state of a single database
No parameter schema in public metadata yet.
delete-manyRemoves all documents that match the filter from a MongoDB collectionRemoves all documents that match the filter from a MongoDB collection
No parameter schema in public metadata yet.
disconnectClose a MongoDB connection and revoke its connectionId.Close a MongoDB connection and revoke its connectionId.
No parameter schema in public metadata yet.
drop-collectionRemoves a collection or view from the database. The method also removes any indexes associated with the dropped collection.Removes a collection or view from the database. The method also removes any indexes associated with the dropped collection.
No parameter schema in public metadata yet.
drop-databaseRemoves the specified database, deleting the associated data filesRemoves the specified database, deleting the associated data files
No parameter schema in public metadata yet.
drop-indexDrop an index for the provided database and collection.Drop an index for the provided database and collection.
No parameter schema in public metadata yet.
explainReturns statistics describing the execution of the winning plan chosen by the query optimizer for the evaluated methodReturns statistics describing the execution of the winning plan chosen by the query optimizer for the evaluated method
No parameter schema in public metadata yet.
exportExport a query or aggregation results in the specified EJSON format.Export a query or aggregation results in the specified EJSON format.
No parameter schema in public metadata yet.
findRun a find query against a MongoDB collectionRun a find query against a MongoDB collection
No parameter schema in public metadata yet.
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.Insert an array of documents into a MongoDB collection. If the list of documents is above com.mongodb/maxRequestPayloadBytes, consider inserting them in batches.
No parameter schema in public metadata yet.
list-collectionsList all collections for a given databaseList all collections for a given database
No parameter schema in public metadata yet.
list-connectionsList the active MongoDB connections and their connectionIds. Use this to find a connectionId established earlier.List the active MongoDB connections and their connectionIds. Use this to find a connectionId established earlier.
No parameter schema in public metadata yet.
list-databasesList all databases for a MongoDB connectionList all databases for a MongoDB connection
No parameter schema in public metadata yet.
mongodb-logsReturns the most recent logged mongod eventsReturns the most recent logged mongod events
No parameter schema in public metadata yet.
rename-collectionRenames a collection in a MongoDB databaseRenames a collection in a MongoDB database
No parameter schema in public metadata yet.
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.Updates 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.
No parameter schema in public metadata yet.
atlas-connect-clusterConnect to MongoDB Atlas cluster and get back a connectionId to pass to the other MongoDB tools. Each call establishes a new, independent connection — multiple connections can be active at the same time.Connect to MongoDB Atlas cluster and get back a connectionId to pass to the other MongoDB tools. Each call establishes a new, independent connection — multiple connections can be active at the same time.
No parameter schema in public metadata yet.
atlas-create-access-listAllow Ip/CIDR ranges to access your MongoDB Atlas clusters.Allow Ip/CIDR ranges to access your MongoDB Atlas clusters.
No parameter schema in public metadata yet.
atlas-create-clusterCreate a MongoDB Atlas cluster (M10–M80, replica set or single shard). Compute autoscaling is enabled by default: min instance size is set to the selected instance size, max is set two tiers above. Disk autoscaling is always enabled. Encryption at rest with customer-managed ke...Create a MongoDB Atlas cluster (M10–M80, replica set or single shard). Compute autoscaling is enabled by default: min instance size is set to the selected instance size, max is set two tiers above. Disk autoscaling is always enabled. Encryption at rest with customer-managed ke...
No parameter schema in public metadata yet.
atlas-create-db-userCreate an MongoDB Atlas database userCreate an MongoDB Atlas database user
No parameter schema in public metadata yet.
atlas-create-free-clusterCreate a free MongoDB Atlas clusterCreate a free MongoDB Atlas cluster
No parameter schema in public metadata yet.
atlas-create-projectCreate a MongoDB Atlas projectCreate a MongoDB Atlas project
No parameter schema in public metadata yet.
atlas-get-performance-advisorGet MongoDB Atlas performance advisor recommendations and suggestions, which includes the operations: suggested indexes, drop index suggestions, schema suggestions, and a sample of the most recent (max 50) slow query logsGet MongoDB Atlas performance advisor recommendations and suggestions, which includes the operations: suggested indexes, drop index suggestions, schema suggestions, and a sample of the most recent (max 50) slow query logs
No parameter schema in public metadata yet.
atlas-get-regionsList supported MongoDB Atlas regions for a cloud provider.List supported MongoDB Atlas regions for a cloud provider.
No parameter schema in public metadata yet.
atlas-inspect-access-listInspect Ip/CIDR ranges with access to your MongoDB Atlas clusters.Inspect Ip/CIDR ranges with access to your MongoDB Atlas clusters.
No parameter schema in public metadata yet.
atlas-inspect-clusterInspect metadata of a MongoDB Atlas clusterInspect metadata of a MongoDB Atlas cluster
No parameter schema in public metadata yet.
atlas-list-alertsList triggered alerts for a MongoDB Atlas project. These are alerts Atlas has raised, not the alert configurations that define them. Defaults to OPEN alerts; set status to TRACKING or CLOSED to see others.List triggered alerts for a MongoDB Atlas project. These are alerts Atlas has raised, not the alert configurations that define them. Defaults to OPEN alerts; set status to TRACKING or CLOSED to see others.
No parameter schema in public metadata yet.
atlas-list-clustersList MongoDB Atlas clustersList MongoDB Atlas clusters
No parameter schema in public metadata yet.
atlas-list-db-usersList MongoDB Atlas database usersList MongoDB Atlas database users
No parameter schema in public metadata yet.
atlas-list-orgsList MongoDB Atlas organizationsList MongoDB Atlas organizations
No parameter schema in public metadata yet.
atlas-list-projectsList MongoDB Atlas projects.List MongoDB Atlas projects.
No parameter schema in public metadata yet.
atlas-load-sample-datasetLoad a MongoDB sample dataset into an Atlas cluster, or check the status of a previously-initiated load. To start a new load, provide `clusterName` — the load runs asynchronously and the response includes a `jobId` and initial state. To check progress, call this tool again wit...Load a MongoDB sample dataset into an Atlas cluster, or check the status of a previously-initiated load. To start a new load, provide `clusterName` — the load runs asynchronously and the response includes a `jobId` and initial state. To check progress, call this tool again wit...
No parameter schema in public metadata yet.
atlas-pause-resume-clusterPause or resume a dedicated (M10+) MongoDB Atlas cluster.Pause or resume a dedicated (M10+) MongoDB Atlas cluster.
No parameter schema in public metadata yet.
atlas-streams-buildCreate Atlas Stream Processing resources. Use this tool for 'set up a Kafka pipeline', 'create a workspace', 'add a connection', or 'deploy a processor'. Use resource='workspace' to create a new workspace (specify cloud provider, region, and tier). Use resource='connection' to...Create Atlas Stream Processing resources. Use this tool for 'set up a Kafka pipeline', 'create a workspace', 'add a connection', or 'deploy a processor'. Use resource='workspace' to create a new workspace (specify cloud provider, region, and tier). Use resource='connection' to...
No parameter schema in public metadata yet.
atlas-streams-discoverDiscover and inspect Atlas Stream Processing resources. Also use for 'why is my processor failing', 'what workspaces do I have', 'show processor stats', or 'check processor health'. Use 'list-workspaces' to see all workspaces in a project. Use inspect actions for details on a...Discover and inspect Atlas Stream Processing resources. Also use for 'why is my processor failing', 'what workspaces do I have', 'show processor stats', or 'check processor health'. Use 'list-workspaces' to see all workspaces in a project. Use inspect actions for details on a...
No parameter schema in public metadata yet.
atlas-streams-manageManage Atlas Stream Processing resources: start/stop processors, modify pipelines, update configurations. Also use for 'change the pipeline', 'scale up my processor', or 'update my workspace tier'. Common workflow: action='stop-processor' → action='modify-processor' → action='...Manage Atlas Stream Processing resources: start/stop processors, modify pipelines, update configurations. Also use for 'change the pipeline', 'scale up my processor', or 'update my workspace tier'. Common workflow: action='stop-processor' → action='modify-processor' → action='...
No parameter schema in public metadata yet.
atlas-streams-teardownDelete Atlas Stream Processing resources. Also use for 'remove my workspace', 'disconnect a source', 'delete all processors', or 'clean up my streams environment'. Performs basic safety checks before deletion: summarizes counts of processors and connections, highlights connect...Delete Atlas Stream Processing resources. Also use for 'remove my workspace', 'disconnect a source', 'delete all processors', or 'clean up my streams environment'. Performs basic safety checks before deletion: summarizes counts of processors and connections, highlights connect...
No parameter schema in public metadata yet.
atlas-upgrade-clusterUpgrade or scale a MongoDB Atlas cluster. Free and Flex clusters can be upgraded to Flex or M10 Dedicated. Dedicated clusters can be scaled to a different instance size, and compute autoscaling settings can be updated. When scaling a Dedicated cluster, at least one of targetTi...Upgrade or scale a MongoDB Atlas cluster. Free and Flex clusters can be upgraded to Flex or M10 Dedicated. Dedicated clusters can be scaled to a different instance size, and compute autoscaling settings can be updated. When scaling a Dedicated cluster, at least one of targetTi...
No parameter schema in public metadata yet.
atlas-local-connect-deploymentConnect to a MongoDB Atlas Local deployment and get back a connectionId to pass to the other MongoDB toolsConnect to a MongoDB Atlas Local deployment and get back a connectionId to pass to the other MongoDB tools
No parameter schema in public metadata yet.
atlas-local-create-deploymentCreate a MongoDB Atlas local deployment. Default image is preview. When the user does not specify an image tag, inform them that preview is used by default and provide this link for more information: https://hub.docker.com/r/mongodb/mongodb-atlas-localCreate a MongoDB Atlas local deployment. Default image is preview. When the user does not specify an image tag, inform them that preview is used by default and provide this link for more information: https://hub.docker.com/r/mongodb/mongodb-atlas-local
No parameter schema in public metadata yet.
atlas-local-delete-deploymentDelete a MongoDB Atlas local deploymentDelete a MongoDB Atlas local deployment
No parameter schema in public metadata yet.
atlas-local-list-deploymentsList MongoDB Atlas local deploymentsList MongoDB Atlas local deployments
No parameter schema in public metadata yet.
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.List 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.
No parameter schema in public metadata yet.
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.Search 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.
No parameter schema in public metadata yet.
Sponsors
MDB_MCP_AGGREGATION_COUNT_MAX_TIME_MS_CAPDeprecated. Use `aggregationCountTimeoutMs` instead.
MDB_MCP_AGGREGATION_COUNT_TIMEOUT_MSThe maximum time in milliseconds for the count phase of aggregation operations. This is used to limit the time spent counting documents when determining if results were capped.
MDB_MCP_ALLOW_REQUEST_OVERRIDESWhen set to true, allows configuration values to be overridden via request headers and query parameters.
MDB_MCP_API_CLIENT_IDsecretAtlas API client ID for authentication. Required for running Atlas tools.
MDB_MCP_API_CLIENT_SECRETsecretAtlas API client secret for authentication. Required for running Atlas tools.
MDB_MCP_ASSISTANT_BASE_URLBase URL for the MongoDB Assistant API.
MDB_MCP_ATLAS_TEMPORARY_DATABASE_USER_LIFETIME_MSTime in milliseconds that temporary database users created when connecting to MongoDB Atlas clusters will remain active before being automatically deleted.
MDB_MCP_CONFIRMATION_REQUIRED_TOOLSComma separated values of tool names that require user confirmation before execution. Requires the client to support elicitation.
MDB_MCP_CONNECTION_IDLE_TIMEOUT_MSMilliseconds a MongoDB connection may stay unused (no tool call touching it) before it is closed to release the underlying connection pool and its server-side state. Applied per connection regardless of its connection scope; the preconfigured connection is excluded, and the reape
MDB_MCP_CONNECTION_SCOPEVisibility scope for MongoDB connections created at runtime. With 'session' (the default), each MCP session only sees the connections it created (plus the shared 'preconfigured' one) and they are closed when the session ends. With 'global', connections are shared across all sessi
MDB_MCP_CONNECTION_STRINGsecretMongoDB connection string for direct database connections, exposed under the connectionId "preconfigured". Optional, if not set, you'll need to call the connect tool before interacting with MongoDB data. Deprecated: prefer the "preconfigured" entry of connectionStrings.
MDB_MCP_CONNECTION_STRINGSsecretMongoDB connection strings keyed by name, as a JSON object (e.g. {"preconfigured": "mongodb://...", "analytics": "mongodb://..."}). Each name becomes a connectionId that the MongoDB tools can use directly, so one server can reach several deployments. Connections are opened on fir
MDB_MCP_DANGEROUS_HOST_BINDINGWhen set to true, allows binding the HTTP server (and monitoring server) to a non-loopback host such as 0.0.0.0, a LAN IP, or an empty host (all interfaces). Binding to a non-loopback host exposes the server to the entire network and can allow unauthorized access. Off by default:
MDB_MCP_DISABLE_SERVER_SIDE_JSWhen set to true, disallows the use of server-side JavaScript operators (such as $where, $function, and $accumulator) in query filters and aggregation pipelines.
MDB_MCP_DISABLE_UNTRUSTED_DATA_WARNINGWhen set to true, tool responses include potentially untrusted data (such as documents or query results) as-is, without wrapping it in delimiters and a prompt-injection warning.
MDB_MCP_DISABLED_TOOLSComma separated values of tool names, operation types, and/or categories of tools that will be disabled.
MDB_MCP_DRY_RUNWhen true, runs the server in dry mode: dumps configuration and enabled tools, then exits without starting the server.
MDB_MCP_ELICITATION_TIMEOUT_MSTime in milliseconds the user has to respond to an elicitation request (such as a tool confirmation prompt) before it fails.
MDB_MCP_EVICTION_IDLE_GRACE_M_SHow long a session must be idle before it becomes eligible for least-recently-used eviction when the HTTP transport is at its maxSessions cap (only used when transport is 'http'). Swept back to idleTimeoutMs when larger.
MDB_MCP_EXPORT_CLEANUP_INTERVAL_MSTime in milliseconds between export cleanup cycles that remove expired export files.
MDB_MCP_EXPORT_TIMEOUT_MSTime in milliseconds after which an export is considered expired and eligible for cleanup.
MDB_MCP_EXPORTS_PATHFolder to store exported data files.
MDB_MCP_EXTERNALLY_MANAGED_SESSIONSWhen true, the 2025-era HTTP transport accepts a session ID supplied externally through the 'mcp-session-id' header. When an external ID is supplied, the initialization request is optional, and an implicitly re-initialized session restores the client's previously negotiated capab
MDB_MCP_HEALTH_CHECK_HOSTDeprecated. Use `monitoringServerHost` instead. Host address to bind the healthCheck HTTP server to (only used when transport is 'http'). If provided, `healthCheckPort` must also be set.
mongodb-mcp-server