MongoDB MCP Server
OfficialServer Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| DO_NOT_TRACK | No | When set to 1, disables telemetry collection | |
| MDB_MCP_LOG_PATH | No | Folder to store logs | |
| MDB_MCP_READ_ONLY | No | When set to true, only allows read and metadata operation types, disabling create/update/delete operations | |
| MDB_MCP_TELEMETRY | No | When set to disabled, disables telemetry collection | |
| MDB_MCP_API_CLIENT_ID | No | Atlas API client ID for authentication | |
| MDB_MCP_DISABLED_TOOLS | No | A comma-separated list of tool names, operation types, and/or categories of tools that will be disabled | |
| MDB_MCP_API_CLIENT_SECRET | No | Atlas API client secret for authentication | |
| MDB_MCP_CONNECTION_STRING | No | MongoDB connection string for direct database connections (optional users may choose to inform it on every tool call) |
Capabilities
Server capabilities have not been inspected yet.
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| aggregateA | Run an aggregation against a MongoDB collection |
| collection-indexesB | 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 |
| db-statsB | Returns statistics that reflect the use state of a single database |
| explainB | Returns statistics describing the execution of the winning plan chosen by the query optimizer for the evaluated method |
| exportA | Export a query or aggregation results in the specified EJSON format. |
| findB | Run a find query against a MongoDB collection |
| list-collectionsB | List all collections for a given database |
| list-databasesA | List all databases for a MongoDB connection |
| mongodb-logsB | Returns the most recent logged mongod events |
| atlas-connect-clusterB | Connect to MongoDB Atlas cluster |
| atlas-get-performance-advisorA | Get MongoDB Atlas performance advisor recommendations, which includes the operations: suggested indexes, drop index suggestions, schema suggestions, and a sample of the most recent (max 50) slow query logs |
| atlas-inspect-access-listB | Inspect Ip/CIDR ranges with access to your MongoDB Atlas clusters. |
| atlas-inspect-clusterB | Inspect MongoDB Atlas cluster |
| atlas-list-alertsB | List MongoDB Atlas alerts |
| atlas-list-clustersB | List MongoDB Atlas clusters |
| atlas-list-db-usersB | List MongoDB Atlas database users |
| atlas-list-orgsB | List MongoDB Atlas organizations |
| atlas-list-projectsA | List MongoDB Atlas projects |
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
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/mongodb-js/mongodb-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server