MongoDB MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| NO_PROXY | No | Comma-separated list of hosts/domains that bypass the proxy. | |
| ALL_PROXY | No | Fallback proxy used for all protocols. | |
| HTTP_PROXY | No | Proxy used for plain HTTP requests. | |
| HTTPS_PROXY | No | Proxy used for HTTPS requests (Atlas API, OIDC, Assistant). | |
| DO_NOT_TRACK | No | When set to 1, disables telemetry collection. | |
| MDB_MCP_CONFIG | No | Path to a JSON configuration file. | |
| MDB_MCP_DRY_RUN | No | When true, runs the server in dry mode: dumps configuration and enabled tools, then exits without starting the server. | false |
| MDB_MCP_LOGGERS | No | Comma separated values of logger types. | disk,mcp |
| MDB_MCP_LOG_PATH | No | Folder to store logs. | |
| MDB_MCP_HTTP_HOST | No | Host address to bind the HTTP server to (only used when transport is 'http'). | 127.0.0.1 |
| MDB_MCP_HTTP_PORT | No | Port number for the HTTP server (only used when transport is 'http'). Use 0 for a random port. | 3000 |
| MDB_MCP_READ_ONLY | No | When set to true, only allows read, connect, and metadata operation types, disabling create/update/delete operations. | false |
| MDB_MCP_TELEMETRY | No | When set to disabled, disables telemetry collection. | enabled |
| MDB_MCP_TRANSPORT | No | Either 'stdio' or 'http'. | stdio |
| MDB_MCP_INDEX_CHECK | No | When set to true, enforces that query operations must use an index, rejecting queries that perform a collection scan. | false |
| MDB_MCP_EXPORTS_PATH | No | Folder to store exported data files. | |
| MDB_MCP_HTTP_HEADERS | No | Header that the HTTP server will validate when making requests (only used when transport is 'http'). | {} |
| MDB_MCP_MAX_SESSIONS | No | Maximum number of concurrent sessions the HTTP transport will hold in memory (only used when transport is 'http'). Each session holds a full server instance, transport, and timers, so choose a value based on your deployment's available memory; the default is a conservative safety net rather than a recommended production value. | 1000 |
| MDB_MCP_MAX_TIME_M_S | No | The maximum time in milliseconds that operations are allowed to run on the MongoDB server. When set, this value is passed as the maxTimeMS option to read operations such as find, aggregate, and count. | |
| MDB_MCP_API_CLIENT_ID | No | Atlas API client ID for authentication. Required for running Atlas tools. | |
| MDB_MCP_DISABLED_TOOLS | No | Comma separated values of tool names, operation types, and/or categories of tools that will be disabled. | |
| MDB_MCP_VOYAGE_API_KEY | No | API key for Voyage AI embeddings service (required for creating Atlas Local deployments with auto-embed vector search capabilities). | |
| MDB_MCP_HTTP_BODY_LIMIT | No | Maximum size of the HTTP request body in bytes (only used when transport is 'http'). This value is passed as the optional limit parameter to the Express.js json() middleware. | 102400 |
| MDB_MCP_IDLE_TIMEOUT_MS | No | Idle timeout for a client to disconnect (only applies to http transport). | 600000 |
| MDB_MCP_PREVIEW_FEATURES | No | Comma separated values of preview features that are enabled. | |
| MDB_MCP_API_CLIENT_SECRET | No | Atlas API client secret for authentication. Required for running Atlas tools. | |
| MDB_MCP_CONNECTION_STRING | No | MongoDB connection string for direct database connections. Optional, if not set, you'll need to call the connect tool before interacting with MongoDB data. | |
| MDB_MCP_EXPORT_TIMEOUT_MS | No | Time in milliseconds after which an export is considered expired and eligible for cleanup. | 300000 |
| MDB_MCP_HEALTH_CHECK_HOST | No | Deprecated. 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. | |
| MDB_MCP_HEALTH_CHECK_PORT | No | Deprecated. Use monitoringServerPort instead. Port number for the healthCheck HTTP server (only used when transport is 'http'). If provided, healthCheckHost must also be set. | |
| MDB_MCP_ASSISTANT_BASE_URL | No | Base URL for the MongoDB Assistant API. | https://knowledge.mongodb.com/api/v1/ |
| MDB_MCP_HTTP_RESPONSE_TYPE | No | The HTTP response type for tool responses: 'sse' for Server-Sent Events, 'json' for standard JSON responses. | sse |
| MDB_MCP_MAX_BYTES_PER_QUERY | No | The maximum size in bytes for results from a find or aggregate tool call. This serves as an upper bound for the responseBytesLimit parameter in those tools. | 16777216 |
| MDB_MCP_MCP_CLIENT_LOG_LEVEL | No | Minimum severity level for log messages forwarded to the MCP client. | debug |
| MDB_MCP_DISABLE_SERVER_SIDE_JS | No | When set to true, disallows the use of server-side JavaScript operators (such as $where, $function, and $accumulator) in query filters and aggregation pipelines. | true |
| MDB_MCP_MONITORING_SERVER_HOST | No | Host address to bind the monitoring HTTP server to (only used when transport is 'http'). If provided, monitoringServerPort must also be set. | |
| MDB_MCP_MONITORING_SERVER_PORT | No | Port number for the monitoring HTTP server (only used when transport is 'http'). If provided, monitoringServerHost must also be set. | |
| MDB_MCP_ALLOW_REQUEST_OVERRIDES | No | When set to true, allows configuration values to be overridden via request headers and query parameters. | false |
| MDB_MCP_MAX_DOCUMENTS_PER_QUERY | No | The maximum number of documents that can be returned by a find or aggregate tool call. For the find tool, the effective limit will be the smaller of this value and the tool's limit parameter. | 100 |
| MDB_MCP_NOTIFICATION_TIMEOUT_MS | No | Notification timeout for a client to be aware of disconnect (only applies to http transport). | 540000 |
| MDB_MCP_EXPORT_CLEANUP_INTERVAL_MS | No | Time in milliseconds between export cleanup cycles that remove expired export files. | 120000 |
| MDB_MCP_MONITORING_SERVER_FEATURES | No | Features to expose on the monitoring server (only used when transport is 'http' and monitoringServerHost/monitoringServerPort are set). | health-check |
| MDB_MCP_CONFIRMATION_REQUIRED_TOOLS | No | Comma separated values of tool names that require user confirmation before execution. Requires the client to support elicitation. | atlas-create-access-list,atlas-create-db-user,drop-database,drop-collection,delete-many,drop-index,atlas-streams-manage,atlas-streams-teardown |
| MDB_MCP_EXTERNALLY_MANAGED_SESSIONS | No | When true, the HTTP transport allows requests with a session ID supplied externally through the 'mcp-session-id' header. When an external ID is supplied, the initialization request is optional. | false |
| MDB_MCP_ATLAS_TEMPORARY_DATABASE_USER_LIFETIME_MS | No | Time in milliseconds that temporary database users created when connecting to MongoDB Atlas clusters will remain active before being automatically deleted. | 14400000 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| resources | {
"subscribe": true,
"listChanged": true
} |
| completions | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| aggregate-dbC | Run an aggregation against a MongoDB database |
| aggregateB | Run an aggregation against a MongoDB collection |
| collection-indexesA | Describe the indexes for a collection |
| collection-schemaB | Describe the schema for a collection |
| collection-storage-sizeB | Gets the size of the collection |
| connectA | Connect 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. |
| countA | Gets the number of documents in a MongoDB collection using db.collection.count() and query as an optional filter parameter |
| create-collectionA | Creates a new collection in a database. If the database doesn't exist, it will be created automatically. |
| create-indexB | Create an index for a collection |
| db-statsB | Returns statistics that reflect the use state of a single database |
| delete-manyA | Removes all documents that match the filter from a MongoDB collection |
| drop-collectionA | Removes a collection or view from the database. The method also removes any indexes associated with the dropped collection. |
| drop-databaseA | Removes the specified database, deleting the associated data files |
| drop-indexA | Drop an index for the provided database and collection. |
| explainA | Returns statistics describing the execution of the winning plan chosen by the query optimizer for the evaluated method |
| exportB | Export a query or aggregation results in the specified EJSON format. |
| findB | Run a find query against a MongoDB collection |
| insert-manyA | 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-collectionsA | List all collections for a given database |
| list-databasesA | List all databases for a MongoDB connection |
| mongodb-logsA | Returns the most recent logged mongod events |
| rename-collectionB | Renames a collection in a MongoDB database |
| update-manyA | 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. |
| list-knowledge-sourcesA | 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-knowledgeA | 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. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| config | Server configuration, supplied by the user either as environment variables or as startup arguments |
| debug-mongodb | Debugging information for MongoDB connectivity issues. Tracks the last connectivity attempt and error information. |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Vijayakumar-DevOps/mongo-mcp-1.14.0'
If you have feedback or need assistance with the MCP directory API, please join our Discord server