Home / Market / mongodb-mcp-server

mongodb-mcp-server

Official MongoDB MCP server: let AI agents search and manage databases and the Atlas data platform

mcp★ 0167494 dlmcp-registryMIT configuration; upstream service license appliesInstall in CosmosUpstream Source

Documentation & Preview

{ "mcpServers": { "mcp-mongodb-mcp-server-cda8fece93b94a51aafe": { "command": "npx", "args": [ "-y", "--package", "mongodb-mcp-server@3.4.0", "mongodb-mcp-server" ], "env": { "MDB_MCP_AGGREGATION_COUNT_MAX_TIME_MS_CAP": "${ENV_MDB_MCP_AGGREGATION_COUNT_MAX_TIME_MS_CAP}", "MDB_MCP_AGGREGATION_COUNT_TIMEOUT_MS": "${ENV_MDB_MCP_AGGREGATION_COUNT_TIMEOUT_MS}", "MDB_MCP_ALLOW_REQUEST_OVERRIDES": "${ENV_MDB_MCP_ALLOW_REQUEST_OVERRIDES}", "MDB_MCP_API_CLIENT_ID": "${ENV_MDB_MCP_API_CLIENT_ID}", "MDB_MCP_API_CLIENT_SECRET": "${ENV_MDB_MCP_API_CLIENT_SECRET}", "MDB_MCP_ASSISTANT_BASE_URL": "${ENV_MDB_MCP_ASSISTANT_BASE_URL}", "MDB_MCP_ATLAS_TEMPORARY_DATABASE_USER_LIFETIME_MS": "${ENV_MDB_MCP_ATLAS_TEMPORARY_DATABASE_USER_LIFETIME_MS}", "MDB_MCP_CONFIRMATION_REQUIRED_TOOLS": "${ENV_MDB_MCP_CONFIRMATION_REQUIRED_TOOLS}", "MDB_MCP_CONNECTION_CONNECT_TIMEOUT_MS": "${ENV_MDB_MCP_CONNECTION_CONNECT_TIMEOUT_MS}", "MDB_MCP_CONNECTION_IDLE_TIMEOUT_MS": "${ENV_MDB_MCP_CONNECTION_IDLE_TIMEOUT_MS}", "MDB_MCP_CONNECTION_SCOPE": "${ENV_MDB_MCP_CONNECTION_SCOPE}", "MDB_MCP_CONNECTION_STRING": "${ENV_MDB_MCP_CONNECTION_STRING}", "MDB_MCP_CONNECTION_STRINGS": "${ENV_MDB_MCP_CONNECTION_STRINGS}", "MDB_MCP_DANGEROUS_HOST_BINDING": "${ENV_MDB_MCP_DANGEROUS_HOST_BINDING}", "MDB_MCP_DISABLE_SERVER_SIDE_JS": "${ENV_MDB_MCP_DISABLE_SERVER_SIDE_JS}", "MDB_MCP_DISABLE_UNTRUSTED_DATA_WARNING": "${ENV_MDB_MCP_DISABLE_UNTRUSTED_DATA_WARNING}", "MDB_MCP_DISABLED_TOOLS": "${ENV_MDB_MCP_DISABLED_TOOLS}", "MDB_MCP_DRY_RUN": "${ENV_MDB_MCP_DRY_RUN}", "MDB_MCP_ELICITATION_TIMEOUT_MS": "${ENV_MDB_MCP_ELICITATION_TIMEOUT_MS}", "MDB_MCP_EVICTION_IDLE_GRACE_M_S": "${ENV_MDB_MCP_EVICTION_IDLE_GRACE_M_S}", "MDB_MCP_EXPORT_CLEANUP_INTERVAL_MS": "${ENV_MDB_MCP_EXPORT_CLEANUP_INTERVAL_MS}", "MDB_MCP_EXPORT_TIMEOUT_MS": "${ENV_MDB_MCP_EXPORT_TIMEOUT_MS}", "MDB_MCP_EXPORTS_PATH": "${ENV_MDB_MCP_EXPORTS_PATH}", "MDB_MCP_EXTERNALLY_MANAGED_SESSIONS": "${ENV_MDB_MCP_EXTERNALLY_MANAGED_SESSIONS}", "MDB_MCP_HEALTH_CHECK_HOST": "${ENV_MDB_MCP_HEALTH_CHECK_HOST}", "MDB_MCP_HEALTH_CHECK_PORT": "${ENV_MDB_MCP_HEALTH_CHECK_PORT}", "MDB_MCP_HTTP_BODY_LIMIT": "${ENV_MDB_MCP_HTTP_BODY_LIMIT}", "MDB_MCP_HTTP_HEADERS": "${ENV_MDB_MCP_HTTP_HEADERS}", "MDB_MCP_HTTP_HOST": "${ENV_MDB_MCP_HTTP_HOST}", "MDB_MCP_HTTP_PORT": "${ENV_MDB_MCP_HTTP_PORT}", "MDB_MCP_HTTP_RESPONSE_TYPE": "${ENV_MDB_MCP_HTTP_RESPONSE_TYPE}", "MDB_MCP_IDLE_TIMEOUT_MS": "${ENV_MDB_MCP_IDLE_TIMEOUT_MS}", "MDB_MCP_INDEX_CHECK": "${ENV_MDB_MCP_INDEX_CHECK}", "MDB_MCP_LOG_PATH": "${ENV_MDB_MCP_LOG_PATH}", "MDB_MCP_LOGGERS": "${ENV_MDB_MCP_LOGGERS}", "MDB_MCP_MAX_ACTIVE_CONNECTIONS": "${ENV_MDB_MCP_MAX_ACTIVE_CONNECTIONS}", "MDB_MCP_MAX_BYTES_PER_QUERY": "${ENV_MDB_MCP_MAX_BYTES_PER_QUERY}", "MDB_MCP_MAX_DOCUMENTS_PER_QUERY": "${ENV_MDB_MCP_MAX_DOCUMENTS_PER_QUERY}", "MDB_MCP_MAX_SESSIONS": "${ENV_MDB_MCP_MAX_SESSIONS}", "MDB_MCP_MAX_TIME_M_S": "${ENV_MDB_MCP_MAX_TIME_M_S}", "MDB_MCP_MCP_CLIENT_LOG_LEVEL": "${ENV_MDB_MCP_MCP_CLIENT_LOG_LEVEL}", "MDB_MCP_MONITORING_SERVER_FEATURES": "${ENV_MDB_MCP_MONITORING_SERVER_FEATURES}", "MDB_MCP_MONITORING_SERVER_HOST": "${ENV_MDB_MCP_MONITORING_SERVER_HOST}", "MDB_MCP_MONITORING_SERVER_PORT": "${ENV_MDB_MCP_MONITORING_SERVER_PORT}", "MDB_MCP_NOTIFICATION_TIMEOUT_MS": "${ENV_MDB_MCP_NOTIFICATION_TIMEOUT_MS}", "MDB_MCP_PREVIEW_FEATURES": "${ENV_MDB_MCP_PREVIEW_FEATURES}", "MDB_MCP_QUERY_COUNT_MAX_TIME_MS_CAP": "${ENV_MDB_MCP_QUERY_COUNT_MAX_TIME_MS_CAP}", "MDB_MCP_QUERY_COUNT_TIMEOUT_MS": "${ENV_MDB_MCP_QUERY_COUNT_TIMEOUT_MS}", "MDB_MCP_READ_ONLY": "${ENV_MDB_MCP_READ_ONLY}", "MDB_MCP_TELEMETRY": "${ENV_MDB_MCP_TELEMETRY}", "MDB_MCP_TIMEOUT_MS": "${ENV_MDB_MCP_TIMEOUT_MS}", "MDB_MCP_TRANSPORT": "${ENV_MDB_MCP_TRANSPORT}", "MDB_MCP_VOYAGE_API_KEY": "${ENV_MDB_MCP_VOYAGE_API_KEY}" } } }, "setup": { "fields": [ { "id": "ENV_MDB_MCP_AGGREGATION_COUNT_MAX_TIME_MS_CAP", "label": "MDB_MCP_AGGREGATION_COUNT_MAX_TIME_MS_CAP", "description": "Deprecated. Use aggregationCountTimeoutMs instead.", "required": false, "secret": false, "default": "" }, { "id": "ENV_MDB_MCP_AGGREGATION_COUNT_TIMEOUT_MS", "label": "MDB_MCP_AGGREGATION_COUNT_TIMEOUT_MS", "description": "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.", "required": false, "secret": false, "default": "" }, { "id": "ENV_MDB_MCP_ALLOW_REQUEST_OVERRIDES", "label": "MDB_MCP_ALLOW_REQUEST_OVERRIDES", "description": "When set to true, allows configuration values to be overridden via request headers and query parameters.", "required": false, "secret": false, "default": "" }, { "id": "ENV_MDB_MCP_API_CLIENT_ID", "label": "MDB_MCP_API_CLIENT_ID", "description": "Atlas API client ID for authentication. Required for running Atlas tools.", "required": false, "secret": true, "default": "" }, { "id": "ENV_MDB_MCP_API_CLIENT_SECRET", "label": "MDB_MCP_API_CLIENT_SECRET", "description": "Atlas API client secret for authentication. Required for running Atlas tools.", "required": false, "secret": true, "default": "" }, { "id": "ENV_MDB_MCP_ASSISTANT_BASE_URL", "label": "MDB_MCP_ASSISTANT_BASE_URL", "description": "Base URL for the MongoDB Assistant API.", "required": false, "secret": false, "default": "" }, { "id": "ENV_MDB_MCP_ATLAS_TEMPORARY_DATABASE_USER_LIFETIME_MS", "label": "MDB_MCP_ATLAS_TEMPORARY_DATABASE_USER_LIFETIME_MS", "description": "Time in milliseconds that temporary database users created when connecting to MongoDB Atlas clusters will remain active before being automatically deleted.", "required": false, "secret": false, "default": "" }, { "id": "ENV_MDB_MCP_CONFIRMATION_REQUIRED_TOOLS", "label": "MDB_MCP_CONFIRMATION_REQUIRED_TOOLS", "description": "Comma separated values of tool names that require user confirmation before execution. Requires the client to support elicitation.", "required": false, "secret": false, "default": "" }, { "id": "ENV_MDB_MCP_CONNECTION_CONNECT_TIMEOUT_MS", "label": "MDB_MCP_CONNECTION_CONNECT_TIMEOUT_MS", "description": "Milliseconds a MongoDB connection may stay in the 'connecting' state (e.g. an in-progress OIDC flow) before it is closed. Bounds a dial that never settles so it cannot pin a connection indefinitely. Kept separate from connectionIdleTimeoutMs so lowering the idle timeout does not abort legitimate multi-minute auth flows. Set to 0 to disable; must not be negative. App-level setting, enforced by the shared reaper, so it cannot be overridden per request.", "required": false, "secret": false, "default": "" }, { "id": "ENV_MDB_MCP_CONNECTION_IDLE_TIMEOUT_MS", "label": "MDB_MCP_CONNECTION_IDLE_TIMEOUT_MS", "description": "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.", "required": false, "secret": false, "default": "" }, { "id": "ENV_MDB_MCP_CONNECTION_SCOPE", "label": "MDB_MCP_CONNECTION_SCOPE", "description": "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 al", "required": false, "secret": false, "default": "" }, { "id": "ENV_MDB_MCP_CONNECTION_STRING", "label": "MDB_MCP_CONNECTION_STRING", "description": "MongoDB 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.", "required": false, "secret": true, "default": "" }, { "id": "ENV_MDB_MCP_CONNECTION_STRINGS", "label": "MDB_MCP_CONNECTION_STRINGS", "description": "MongoDB 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 first use. Environment variable or config file only.", "required": false, "secret": true, "default": "" }, { "id": "ENV_MDB_MCP_DANGEROUS_HOST_BINDING", "label": "MDB_MCP_DANGEROUS_HOST_BINDING", "description": "When 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: the server refuses to start on a non-loopback host unless this is true.", "required": false, "secret": false, "default": "" }, { "id": "ENV_MDB_MCP_DISABLE_SERVER_SIDE_JS", "label": "MDB_MCP_DISABLE_SERVER_SIDE_JS", "description": "When set to true, disallows the use of server-side JavaScript operators (such as $where, $function, and $accumulator) in query filters and aggregation pipelines.", "required": false, "secret": false, "default": "" }, { "id": "ENV_MDB_MCP_DISABLE_UNTRUSTED_DATA_WARNING", "label": "MDB_MCP_DISABLE_UNTRUSTED_DATA_WARNING", "description": "When 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.", "required": false, "secret": false, "default": "" }, { "id": "ENV_MDB_MCP_DISABLED_TOOLS", "label": "MDB_MCP_DISABLED_TOOLS", "description": "Comma separated values of tool names, operation types, and/or categories of tools that will be disabled.", "required": false, "secret": false, "default": "" }, { "id": "ENV_MDB_MCP_DRY_RUN", "label": "MDB_MCP_D