About
MongoDB Model Context Protocol Server
Security Report
Valid MCP server (5 strong, 2 medium validity signals). No known CVEs in dependencies. ⚠️ Package registry links to a different repository than scanned source. Imported from the Official MCP Registry. 1 finding(s) downgraded by scanner intelligence.
12 files analyzed · 1 issue found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
Permissions Required
This plugin requests these system permissions. Most are normal for its category.
What You'll Need
Set these up before or after installing:
Environment variable: MDB_MCP_AGGREGATION_COUNT_MAX_TIME_MS_CAP
Environment variable: MDB_MCP_AGGREGATION_COUNT_TIMEOUT_MS
Environment variable: MDB_MCP_ALLOW_REQUEST_OVERRIDES
Environment variable: MDB_MCP_API_CLIENT_ID
Environment variable: MDB_MCP_API_CLIENT_SECRET
Environment variable: MDB_MCP_ASSISTANT_BASE_URL
Environment variable: MDB_MCP_ATLAS_TEMPORARY_DATABASE_USER_LIFETIME_MS
Environment variable: MDB_MCP_CONFIRMATION_REQUIRED_TOOLS
Environment variable: MDB_MCP_CONNECTION_IDLE_TIMEOUT_MS
Environment variable: MDB_MCP_CONNECTION_SCOPE
Environment variable: MDB_MCP_CONNECTION_STRING
Environment variable: MDB_MCP_DANGEROUS_HOST_BINDING
Environment variable: MDB_MCP_DISABLE_SERVER_SIDE_JS
Environment variable: MDB_MCP_DISABLE_UNTRUSTED_DATA_WARNING
Environment variable: MDB_MCP_DISABLED_TOOLS
Environment variable: MDB_MCP_DRY_RUN
Environment variable: MDB_MCP_ELICITATION_TIMEOUT_MS
Environment variable: MDB_MCP_EVICTION_IDLE_GRACE_M_S
Environment variable: MDB_MCP_EXPORT_CLEANUP_INTERVAL_MS
Environment variable: MDB_MCP_EXPORT_TIMEOUT_MS
Environment variable: MDB_MCP_EXPORTS_PATH
Environment variable: MDB_MCP_EXTERNALLY_MANAGED_SESSIONS
Environment variable: MDB_MCP_HEALTH_CHECK_HOST
Environment variable: MDB_MCP_HEALTH_CHECK_PORT
Environment variable: MDB_MCP_HTTP_BODY_LIMIT
Environment variable: MDB_MCP_HTTP_HEADERS
Environment variable: MDB_MCP_HTTP_HOST
Environment variable: MDB_MCP_HTTP_PORT
Environment variable: MDB_MCP_HTTP_RESPONSE_TYPE
Environment variable: MDB_MCP_IDLE_TIMEOUT_MS
Environment variable: MDB_MCP_INDEX_CHECK
Environment variable: MDB_MCP_LOG_PATH
Environment variable: MDB_MCP_LOGGERS
Environment variable: MDB_MCP_MAX_ACTIVE_CONNECTIONS
Environment variable: MDB_MCP_MAX_BYTES_PER_QUERY
Environment variable: MDB_MCP_MAX_DOCUMENTS_PER_QUERY
Environment variable: MDB_MCP_MAX_SESSIONS
Environment variable: MDB_MCP_MAX_TIME_M_S
Environment variable: MDB_MCP_MCP_CLIENT_LOG_LEVEL
Environment variable: MDB_MCP_MONITORING_SERVER_FEATURES
Environment variable: MDB_MCP_MONITORING_SERVER_HOST
Environment variable: MDB_MCP_MONITORING_SERVER_PORT
Environment variable: MDB_MCP_NOTIFICATION_TIMEOUT_MS
Environment variable: MDB_MCP_PREVIEW_FEATURES
Environment variable: MDB_MCP_QUERY_COUNT_MAX_TIME_MS_CAP
Environment variable: MDB_MCP_QUERY_COUNT_TIMEOUT_MS
Environment variable: MDB_MCP_READ_ONLY
Environment variable: MDB_MCP_TELEMETRY
Environment variable: MDB_MCP_TIMEOUT_MS
Environment variable: MDB_MCP_TRANSPORT
Environment variable: MDB_MCP_VOYAGE_API_KEY
How to Install
Add this to your MCP configuration file:
{
"mcpServers": {
"io-github-mongodb-js-mongodb-mcp-server": {
"env": {
"MDB_MCP_DRY_RUN": "your-mdb-mcp-dry-run-here",
"MDB_MCP_LOGGERS": "your-mdb-mcp-loggers-here",
"MDB_MCP_LOG_PATH": "your-mdb-mcp-log-path-here",
"MDB_MCP_HTTP_HOST": "your-mdb-mcp-http-host-here",
"MDB_MCP_HTTP_PORT": "your-mdb-mcp-http-port-here",
"MDB_MCP_READ_ONLY": "your-mdb-mcp-read-only-here",
"MDB_MCP_TELEMETRY": "your-mdb-mcp-telemetry-here",
"MDB_MCP_TRANSPORT": "your-mdb-mcp-transport-here",
"MDB_MCP_TIMEOUT_MS": "your-mdb-mcp-timeout-ms-here",
"MDB_MCP_INDEX_CHECK": "your-mdb-mcp-index-check-here",
"MDB_MCP_EXPORTS_PATH": "your-mdb-mcp-exports-path-here",
"MDB_MCP_HTTP_HEADERS": "your-mdb-mcp-http-headers-here",
"MDB_MCP_MAX_SESSIONS": "your-mdb-mcp-max-sessions-here",
"MDB_MCP_MAX_TIME_M_S": "your-mdb-mcp-max-time-m-s-here",
"MDB_MCP_API_CLIENT_ID": "your-mdb-mcp-api-client-id-here",
"MDB_MCP_DISABLED_TOOLS": "your-mdb-mcp-disabled-tools-here",
"MDB_MCP_VOYAGE_API_KEY": "your-mdb-mcp-voyage-api-key-here",
"MDB_MCP_HTTP_BODY_LIMIT": "your-mdb-mcp-http-body-limit-here",
"MDB_MCP_IDLE_TIMEOUT_MS": "your-mdb-mcp-idle-timeout-ms-here",
"MDB_MCP_CONNECTION_SCOPE": "your-mdb-mcp-connection-scope-here",
"MDB_MCP_PREVIEW_FEATURES": "your-mdb-mcp-preview-features-here",
"MDB_MCP_API_CLIENT_SECRET": "your-mdb-mcp-api-client-secret-here",
"MDB_MCP_CONNECTION_STRING": "your-mdb-mcp-connection-string-here",
"MDB_MCP_EXPORT_TIMEOUT_MS": "your-mdb-mcp-export-timeout-ms-here",
"MDB_MCP_HEALTH_CHECK_HOST": "your-mdb-mcp-health-check-host-here",
"MDB_MCP_HEALTH_CHECK_PORT": "your-mdb-mcp-health-check-port-here",
"MDB_MCP_ASSISTANT_BASE_URL": "your-mdb-mcp-assistant-base-url-here",
"MDB_MCP_HTTP_RESPONSE_TYPE": "your-mdb-mcp-http-response-type-here",
"MDB_MCP_MAX_BYTES_PER_QUERY": "your-mdb-mcp-max-bytes-per-query-here",
"MDB_MCP_MCP_CLIENT_LOG_LEVEL": "your-mdb-mcp-mcp-client-log-level-here",
"MDB_MCP_DANGEROUS_HOST_BINDING": "your-mdb-mcp-dangerous-host-binding-here",
"MDB_MCP_DISABLE_SERVER_SIDE_JS": "your-mdb-mcp-disable-server-side-js-here",
"MDB_MCP_ELICITATION_TIMEOUT_MS": "your-mdb-mcp-elicitation-timeout-ms-here",
"MDB_MCP_MAX_ACTIVE_CONNECTIONS": "your-mdb-mcp-max-active-connections-here",
"MDB_MCP_MONITORING_SERVER_HOST": "your-mdb-mcp-monitoring-server-host-here",
"MDB_MCP_MONITORING_SERVER_PORT": "your-mdb-mcp-monitoring-server-port-here",
"MDB_MCP_QUERY_COUNT_TIMEOUT_MS": "your-mdb-mcp-query-count-timeout-ms-here",
"MDB_MCP_ALLOW_REQUEST_OVERRIDES": "your-mdb-mcp-allow-request-overrides-here",
"MDB_MCP_EVICTION_IDLE_GRACE_M_S": "your-mdb-mcp-eviction-idle-grace-m-s-here",
"MDB_MCP_MAX_DOCUMENTS_PER_QUERY": "your-mdb-mcp-max-documents-per-query-here",
"MDB_MCP_NOTIFICATION_TIMEOUT_MS": "your-mdb-mcp-notification-timeout-ms-here",
"MDB_MCP_CONNECTION_IDLE_TIMEOUT_MS": "your-mdb-mcp-connection-idle-timeout-ms-here",
"MDB_MCP_EXPORT_CLEANUP_INTERVAL_MS": "your-mdb-mcp-export-cleanup-interval-ms-here",
"MDB_MCP_MONITORING_SERVER_FEATURES": "your-mdb-mcp-monitoring-server-features-here",
"MDB_MCP_CONFIRMATION_REQUIRED_TOOLS": "your-mdb-mcp-confirmation-required-tools-here",
"MDB_MCP_EXTERNALLY_MANAGED_SESSIONS": "your-mdb-mcp-externally-managed-sessions-here",
"MDB_MCP_QUERY_COUNT_MAX_TIME_MS_CAP": "your-mdb-mcp-query-count-max-time-ms-cap-here",
"MDB_MCP_AGGREGATION_COUNT_TIMEOUT_MS": "your-mdb-mcp-aggregation-count-timeout-ms-here",
"MDB_MCP_DISABLE_UNTRUSTED_DATA_WARNING": "your-mdb-mcp-disable-untrusted-data-warning-here",
"MDB_MCP_AGGREGATION_COUNT_MAX_TIME_MS_CAP": "your-mdb-mcp-aggregation-count-max-time-ms-cap-here",
"MDB_MCP_ATLAS_TEMPORARY_DATABASE_USER_LIFETIME_MS": "your-mdb-mcp-atlas-temporary-database-user-lifetime-ms-here"
},
"args": [
"-y",
"mongodb-mcp-server"
],
"command": "npx"
}
}
}Documentation
View on GitHubFrom the project's GitHub README.
MongoDB MCP Server
A Model Context Protocol server for interacting with MongoDB Databases and MongoDB Atlas.
Quick Start
Using the official MongoDB plugins for AI agents
MongoDB MCP Server comes bundled with the official MongoDB plugins for AI agents. The following plugins are available:
mongodb-atlas — connects to the MongoDB-hosted Atlas MCP server over OAuth. This does not require you to run anything locally, and is the recommended way to connect to MongoDB Atlas from your AI agent:
- Cursor: marketplace
- VSCode: Open the Extensions view (
⇧⌘X/Ctrl+Shift+X), search for@agentPlugins, and installmongodb-atlas. - Claude: marketplace
- Codex: Open
/pluginsand installmongodb-atlas. - GitHub Copilot CLI: Run
copilot plugin install mongodb-atlas. - Grok: Open
/marketplacein Grok Build and installmongodb-atlas.
mongodb — runs the MongoDB MCP server locally and connects to any self-managed deployment:
- Cursor: marketplace
- Claude: marketplace
- Gemini: marketplace
- Codex: Run
codex plugin marketplace add mongodb/agent-skills, then open/pluginsand installmongodb. - GitHub Copilot CLI: Run
copilot plugin install mongodb. - Grok: Open
/marketplacein Grok Build and installmongodb.
Using the setup script
You can manually set up the local MCP server by running the following command:
npx -y mongodb-mcp-server@latest setup
This will guide you through an interactive setup process, including configuring your MongoDB connection string or Atlas API credentials.
For more advanced setup options, see the Manual Setup section below.
Using the MongoDB MCP Server setup skill
You can add and use the MongoDB MCP Server setup skill to configure your local MCP server using an AI agent.
npx skills add https://github.com/mongodb/agent-skills --skill mongodb-mcp-setup
Using manual configuration
See Manual Setup for instructions on how to manually configure the MongoDB MCP Server.
📚 Table of Contents
- 🚀 Getting Started
- 🛠️ Supported Tools
- 📄 Supported Resources
- ⚙️ Configuration
- 🚀 Deploy on Public Clouds
- 🤝 Contributing
Prerequisites
[!NOTE] Node 20.x support is deprecated and will be removed in a future release. Please upgrade to Node 22.13 or later. See https://nodejs.org/en/blog/migrations/v20-to-v22 for migration details.
-
Node.js
- At least v22.13.0. Check with
node -v.
- At least v22.13.0. Check with
-
A MongoDB connection string or Atlas API credentials.
- Service Accounts Atlas API credentials are required to use the Atlas tools. You can create a service account in MongoDB Atlas and use its credentials for authentication. See Atlas API Access for more details.
- If you have a MongoDB connection string, you can use it directly to connect to your MongoDB instance.
Manual Setup
🔒 Security Recommendation 1: When using Atlas API credentials, be sure to assign only the minimum required permissions to your service account. See Atlas API Permissions for details.
🔒 Security Recommendation 2: For enhanced security, we strongly recommend using environment variables to pass sensitive configuration such as connection strings and API credentials instead of command line arguments. Command line arguments can be visible in process lists and logged in various system locations, potentially exposing your secrets. Environment variables provide a more secure way to handle sensitive information.
Most MCP clients require a configuration file to be created or modified to add the MCP server.
Note: The configuration file syntax can be different across clients. Please refer to the following links for the latest expected syntax:
Default Safety Notice: All examples below include
--readOnlyby default to ensure safe, read-only access to your data. Remove--readOnlyif you need to enable write operations.
Option 1: Connection String
You can pass your connection string via environment variables, make sure to use a valid username and password.
{
"mcpServers": {
"MongoDB": {
"command": "npx",
"args": ["-y", "mongodb-mcp-server@latest", "--readOnly"],
"env": {
"MDB_MCP_CONNECTION_STRING": "mongodb://localhost:27017/myDatabase"
}
}
}
}
NOTE: The connection string can be configured to connect to any MongoDB cluster, whether it's a local instance or an Atlas cluster.
Option 2: Connect to the MongoDB Atlas-Managed MCP Server
When working with MongoDB Atlas, the recommended approach is to install the mongodb-atlas plugin for your AI agent, which handles OAuth authentication automatically.
For manual configuration, see the client-specific instructions for setting up the Atlas Remote MCP server with OAuth. Alternatively, you can connect using the mongodb-atlas-mcp-remote package with Service Account credentials — see the package README for setup instructions.
Note: You cannot authenticate to the remote MongoDB MCP server using a static API key over HTTP. You must either:
- Use a client that supports the OAuth flow.
- Use the
mongodb-atlas-mcp-remotestdio server, which you can authenticate into using the staticMDB_MCP_API_CLIENT_IDandMDB_MCP_API_CLIENT_SECRETenvironment variables.
To connect with the mongodb-atlas-mcp-remote stdio server using Service Account credentials, add it to your client's MCP configuration:
{
"mcpServers": {
"mongodb-atlas-mcp-remote": {
"type": "stdio",
"command": "npx",
"args": ["-y", "mongodb-atlas-mcp-remote@latest"],
"env": {
"MDB_MCP_API_CLIENT_ID": "$CLIENT_ID",
"MDB_MCP_API_CLIENT_SECRET": "$SECRET"
}
}
}
}
Option 3: Atlas API Credentials
Use your Atlas API Service Accounts credentials. Must follow all the steps in Atlas API Access section.
{
"mcpServers": {
"MongoDB": {
"command": "npx",
"args": ["-y", "mongodb-mcp-server@latest", "--readOnly"],
"env": {
"MDB_MCP_API_CLIENT_ID": "your-atlas-service-accounts-client-id",
"MDB_MCP_API_CLIENT_SECRET": "your-atlas-service-accounts-client-secret"
}
}
}
}
Option 4: Standalone Service using environment variables and command line arguments
You can source environment variables defined in a config file or explicitly set them like we do in the example below and run the server via npx.
# Set your credentials as environment variables first
export MDB_MCP_API_CLIENT_ID="your-atlas-service-accounts-client-id"
export MDB_MCP_API_CLIENT_SECRET="your-atlas-service-accounts-client-secret"
# Then start the server
npx -y mongodb-mcp-server@latest --readOnly
💡 Platform Note: The examples above use Unix/Linux/macOS syntax. For Windows users, see Environment Variables for platform-specific instructions.
- For a complete list of configuration options see Configuration Options
- To configure your Atlas Service Accounts credentials please refer to Atlas API Access
- Connection String via environment variables in the MCP file example
- Atlas API credentials via environment variables in the MCP file example
Option 5: Using Docker
You can run the MongoDB MCP Server in a Docker container, which provides isolation and doesn't require a local Node.js installation.
Run with Environment Variables
You may provide either a MongoDB connection string OR Atlas API credentials:
Option A: No configuration
docker run --rm -i \
mongodb/mongodb-mcp-server:latest
Option B: With MongoDB connection string
# Set your credentials as environment variables first
export MDB_MCP_CONNECTION_STRING="mongodb+srv://username:password@cluster.mongodb.net/myDatabase"
# Then start the docker container
docker run --rm -i \
-e MDB_MCP_CONNECTION_STRING \
-e MDB_MCP_READ_ONLY="true" \
mongodb/mongodb-mcp-server:latest
💡 Platform Note: The examples above use Unix/Linux/macOS syntax. For Windows users, see Environment Variables for platform-specific instructions.
Option C: With Atlas API credentials
# Set your credentials as environment variables first
export MDB_MCP_API_CLIENT_ID="your-atlas-service-accounts-client-id"
export MDB_MCP_API_CLIENT_SECRET="your-atlas-service-accounts-client-secret"
# Then start the docker container
docker run --rm -i \
-e MDB_MCP_API_CLIENT_ID \
-e MDB_MCP_API_CLIENT_SECRET \
-e MDB_MCP_READ_ONLY="true" \
mongodb/mongodb-mcp-server:latest
💡 Platform Note: The examples above use Unix/Linux/macOS syntax. For Windows users, see Environment Variables for platform-specific instructions.
Docker in MCP Configuration File
Without options:
{
"mcpServers": {
"MongoDB": {
"command": "docker",
"args": [
"run",
"--rm",
"-e",
"MDB_MCP_READ_ONLY=true",
"-i",
"mongodb/mongodb-mcp-server:latest"
]
}
}
}
With connection string:
{
"mcpServers": {
"MongoDB": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"MDB_MCP_CONNECTION_STRING",
"-e",
"MDB_MCP_READ_ONLY=true",
"mongodb/mongodb-mcp-server:latest"
],
"env": {
"MDB_MCP_CONNECTION_STRING": "mongodb+srv://username:password@cluster.mongodb.net/myDatabase"
}
}
}
}
With Atlas API credentials:
{
"mcpServers": {
"MongoDB": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"MDB_MCP_READ_ONLY=true",
"-e",
"MDB_MCP_API_CLIENT_ID",
"-e",
"MDB_MCP_API_CLIENT_SECRET",
"mongodb/mongodb-mcp-server:latest"
],
"env": {
"MDB_MCP_API_CLIENT_ID": "your-atlas-service-accounts-client-id",
"MDB_MCP_API_CLIENT_SECRET": "your-atlas-service-accounts-client-secret"
}
}
}
}
HTTP Compatibility
For custom HTTP clients and hosts, see the library guide's HTTP compatibility requirements, including protocol headers, redirects, legacy sessions, and request size limits.
🛠️ Supported Tools
Tool List
MongoDB Database Tools
aggregate- Run an aggregation against a MongoDB collectionaggregate-db- Run an aggregation against a MongoDB databasecollection-indexes- Describe the indexes for a collectioncollection-schema- Describe the schema for a collectioncollection-storage-size- Gets the size of the collectionconnect- Connect to a MongoDB instancecount- Gets the number of documents in a MongoDB collection using db.collection.count() and query as an optional filter parametercreate-collection- Creates a new collection in a database. If the database doesn't exist, it will be created automatically.create-index- Create an index for a collectiondb-stats- Returns statistics that reflect the use state of a single databasedelete-many- Removes all documents that match the filter from a MongoDB collectiondisconnect- Close a MongoDB connection and revoke its connectionId.drop-collection- Removes a collection or view from the database. The method also removes any indexes associated with the dropped collection.drop-database- Removes the specified database, deleting the associated data filesdrop-index- Drop an index for the provided database and collection.explain- Returns statistics describing the execution of the winning plan chosen by the query optimizer for the evaluated methodexport- Export a query or aggregation results in the specified EJSON format.find- Run a find query against a MongoDB collectioninsert-many- Insert an array of documents into a MongoDB collection. If the list of documents is above com.mongodb/maxRequestPayloadBytes, consider inserting them in batches.list-collections- List all collections for a given databaselist-connections- List the active MongoDB connections and their connectionIds. Use this to find a connectionId established earlier.list-databases- List all databases for a MongoDB connectionmongodb-logs- Returns the most recent logged mongod eventsrename-collection- Renames a collection in a MongoDB databaseupdate-many- 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.
MongoDB Atlas Tools
atlas-connect-cluster- 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.atlas-create-access-list- Allow Ip/CIDR ranges to access your MongoDB Atlas clusters.atlas-create-cluster- 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 keys (CMK) is supported, the CMK provider must already have a valid encryption at rest configuration in the project. The tool returns immediately, use the atlas-inspect-cluster tool to poll the cluster state for readiness (state: IDLE). Connection strings are unavailable until the cluster reaches IDLE state.atlas-create-db-user- Create an MongoDB Atlas database useratlas-create-free-cluster- Create a free MongoDB Atlas clusteratlas-create-project- Create a MongoDB Atlas projectatlas-get-performance-advisor- Get 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 logsatlas-get-regions- List supported MongoDB Atlas regions for a cloud provider.atlas-inspect-access-list- Inspect Ip/CIDR ranges with access to your MongoDB Atlas clusters.atlas-inspect-cluster- Inspect metadata of a MongoDB Atlas clusteratlas-list-alerts- 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.atlas-list-clusters- List MongoDB Atlas clustersatlas-list-db-users- List MongoDB Atlas database usersatlas-list-orgs- List MongoDB Atlas organizationsatlas-list-projects- List MongoDB Atlas projects.atlas-load-sample-dataset- Load a MongoDB sample dataset into an Atlas cluster, or check the status of a previously-initiated load. To start a new load, provideclusterName— the load runs asynchronously and the response includes ajobIdand initial state. To check progress, call this tool again withjobId(sample dataset loads typically take 1–5 minutes). State can be WORKING, COMPLETED, or FAILED.atlas-pause-resume-cluster- Pause or resume a dedicated (M10+) MongoDB Atlas cluster.atlas-streams-build- 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 add a data source or sink to an existing workspace. Use resource='processor' to deploy a stream processor with a pipeline. Use resource='privatelink' to set up private networking. Typical workflow: create workspace → add connections → deploy processor.atlas-streams-discover- 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 specific resource. Use 'diagnose-processor' for a combined health report including state, stats, connection health, and recent errors. Use 'get-networking' for PrivateLink and account details.atlas-streams-manage- 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='start-processor'. Useatlas-streams-discoverwith action 'inspect-processor' to check state before managing.atlas-streams-teardown- 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 connections referenced by processors where possible, and surfaces API errors if processors are still running when deletion is attempted. Useatlas-streams-discoverto review resources before deleting.atlas-upgrade-cluster- 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 targetTier, computeAutoScaling, minInstanceSize, or maxInstanceSize must be provided. Compute autoscaling defaults to enabled when upgrading to M10 Dedicated: min instance size is set to the selected instance size, max is set two tiers above, unless overridden. Note to LLM: If provider and region are not already known, ask for both together in a single question before calling this tool. Use atlas-get-regions to resolve natural-language locations or uncertain region codes before calling this tool.
NOTE: atlas tools are only available when you set credentials on configuration section.
MongoDB Atlas Local Tools
atlas-local-connect-deployment- Connect to a MongoDB Atlas Local deployment and get back a connectionId to pass to the other MongoDB toolsatlas-local-create-deployment- Create 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-localatlas-local-delete-deployment- Delete a MongoDB Atlas local deploymentatlas-local-list-deployments- List MongoDB Atlas local deployments
MongoDB Assistant Tools
list-knowledge-sources- 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.search-knowledge- 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.
📄 Supported Resources
config- Server configuration, supplied by the user either as environment variables or as startup arguments with sensitive parameters redacted. The resource can be accessed under URIconfig://config.debug- Debugging information for MongoDB connectivity issues. Tracks the last connectivity attempt and error information. The resource can be accessed under URIdebug://mongodb.exported-data- A resource template to access the data exported using the export tool. The template can be accessed under URIexported-data://{exportName}whereexportNameis the unique name for an export generated by the export tool.
Configuration
🔒 Security Best Practice: We strongly recommend using environment variables for sensitive configuration such as API credentials (
MDB_MCP_API_CLIENT_ID,MDB_MCP_API_CLIENT_SECRET) and connection strings (MDB_MCP_CONNECTION_STRING) instead of command-line arguments. Environment variables are not visible in process lists and provide better security for your sensitive data.
The MongoDB MCP Server can be configured using multiple methods, with the following precedence (highest to lowest):
- Command-line arguments
- Environment variables
- Configuration File
Configuration Options
| Environment Variable / CLI Option | Default | Description |
|---|---|---|
MDB_MCP_AGGREGATION_COUNT_MAX_TIME_MS_CAP / --aggregationCountMaxTimeMsCap | <not set> | Deprecated. Use aggregationCountTimeoutMs instead. |
MDB_MCP_AGGREGATION_COUNT_TIMEOUT_MS / --aggregationCountTimeoutMs | 60000 | The 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_OVERRIDES / --allowRequestOverrides | false | When set to true, allows configuration values to be overridden via request headers and query parameters. |
MDB_MCP_API_CLIENT_ID / --apiClientId | <not set> | Atlas API client ID for authentication. Required for running Atlas tools. |
MDB_MCP_API_CLIENT_SECRET / --apiClientSecret | <not set> | Atlas API client secret for authentication. Required for running Atlas tools. |
MDB_MCP_ASSISTANT_BASE_URL / --assistantBaseUrl | "https://knowledge.mongodb.com/api/v1/" | Base URL for the MongoDB Assistant API. |
MDB_MCP_ATLAS_TEMPORARY_DATABASE_USER_LIFETIME_MS / --atlasTemporaryDatabaseUserLifetimeMs | 14400000 | Time in milliseconds that temporary database users created when connecting to MongoDB Atlas clusters will remain active before being automatically deleted. |
MDB_MCP_CONFIRMATION_REQUIRED_TOOLS / --confirmationRequiredTools | "atlas-create-access-list,atlas-create-db-user,drop-database,drop-collection,delete-many,drop-index,atlas-streams-manage,atlas-streams-teardown" | Comma separated values of tool names that require user confirmation before execution. Requires the client to support elicitation. |
MDB_MCP_CONNECTION_IDLE_TIMEOUT_MS / --connectionIdleTimeoutMs | 600000 | Milliseconds 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 reaper runs on this cadence. Set to 0 to disable reaping; must not be negative. |
MDB_MCP_CONNECTION_SCOPE / --connectionScope | "session" | Visibility 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 sessions and survive session rotation. Deprecated: the MCP protocol is moving to sessionless, so this option will soon be removed and the connection scope will default to 'global'. For shared-server use cases, use the Atlas-Managed MCP server or build an authenticated library using the @mongodb-js/mcp-cli package. Note: on the sessionless (2026-07-28) HTTP path, a request without an mcp-session-id falls back to the shared ('global') scope so it can still persist connections across requests; the legacy sessionful path always carries a server-issued session. |
MDB_MCP_CONNECTION_STRING / --connectionString | <not set> | MongoDB connection string for direct database connections. Optional, if not set, you'll need to call the connect tool before interacting with MongoDB data. |
Documentation truncated — see the full README on GitHub.
Reviews
No reviews yet
Be the first to review this server!
More Data & Analytics MCP Servers
Toleno
Freeby Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
MCP Marketplace
Freeby mcp-marketplace · Developer Tools
Search and install MCP servers from inside your AI client.
mcp-creator-python
Freeby mcp-marketplace · Developer Tools
Create, build, and publish Python MCP servers to PyPI — conversationally.
by Lharries · Communication
Read, search, and send WhatsApp messages through your AI assistant
FinAgent
Freeby mcp-marketplace · Finance
Free stock data and market news for any MCP-compatible AI assistant.
Memory
Freeby Modelcontextprotocol · Productivity
Knowledge graph-based persistent memory across sessions
