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) |
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 |
| aggregateA | Run an aggregation against a MongoDB collection |
| collection-indexesA | Describe the indexes for a collection |
| collection-schemaC | Describe the schema for a collection |
| collection-storage-sizeB | Gets the size of the collection |
| connectA | Connect to a MongoDB instance 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. A connection with the id "preconfigured" already exists for the connection string the server was configured with — there is no need to call this tool to use it. |
| countA | Gets the number of documents in a MongoDB collection using db.collection.count() and query as an optional filter parameter |
| db-statsA | Returns statistics that reflect the use state of a single database |
| disconnectC | Close a MongoDB connection and revoke its connectionId. Disconnecting the "preconfigured" connection only closes it — it reconnects automatically on next use because the server configuration still declares it. |
| 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-collectionsA | List all collections for a given database |
| list-connectionsA | List the active MongoDB connections and their connectionIds. Use this to discover the "preconfigured" connection or to find a connectionId established earlier. |
| list-databasesA | List all databases for a MongoDB connection |
| mongodb-logsA | Returns the most recent logged mongod events |
| atlas-connect-clusterA | 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-get-performance-advisorA | 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 logs |
| atlas-inspect-access-listA | Inspect Ip/CIDR ranges with access to your MongoDB Atlas clusters. |
| atlas-inspect-clusterB | Inspect metadata of a MongoDB Atlas cluster |
| atlas-list-alertsA | 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-clustersB | List MongoDB Atlas clusters |
| atlas-list-db-usersA | List MongoDB Atlas database users |
| atlas-list-orgsB | List MongoDB Atlas organizations |
| atlas-list-projectsB | List MongoDB Atlas projects. |
| atlas-streams-discoverA | 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. |
| 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. Lists the active connections, their state, and the error from their last failed connection attempt. |
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/mongodb-js/mongodb-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server