Skip to main content
Glama
mongodb-js

MongoDB MCP Server

Official
by mongodb-js

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
DO_NOT_TRACKNoWhen set to 1, disables telemetry collection
MDB_MCP_LOG_PATHNoFolder to store logs
MDB_MCP_READ_ONLYNoWhen set to true, only allows read and metadata operation types, disabling create/update/delete operations
MDB_MCP_TELEMETRYNoWhen set to disabled, disables telemetry collection
MDB_MCP_API_CLIENT_IDNoAtlas API client ID for authentication
MDB_MCP_DISABLED_TOOLSNoA comma-separated list of tool names, operation types, and/or categories of tools that will be disabled
MDB_MCP_API_CLIENT_SECRETNoAtlas API client secret for authentication
MDB_MCP_CONNECTION_STRINGNoMongoDB connection string for direct database connections (optional users may choose to inform it on every tool call)

Tools

Functions exposed to the LLM to take actions

NameDescription
aggregate

Run an aggregation against a MongoDB collection

collection-indexes

Describe the indexes for a collection

collection-schema

Describe the schema for a collection

collection-storage-size

Gets the size of the collection

connect

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.

count

Gets the number of documents in a MongoDB collection using db.collection.count() and query as an optional filter parameter

db-stats

Returns statistics that reflect the use state of a single database

explain

Returns statistics describing the execution of the winning plan chosen by the query optimizer for the evaluated method

export

Export a query or aggregation results in the specified EJSON format.

find

Run a find query against a MongoDB collection

list-collections

List all collections for a given database

list-databases

List all databases for a MongoDB connection

mongodb-logs

Returns the most recent logged mongod events

atlas-connect-cluster

Connect to MongoDB Atlas cluster

atlas-get-performance-advisor

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-list

Inspect Ip/CIDR ranges with access to your MongoDB Atlas clusters.

atlas-inspect-cluster

Inspect MongoDB Atlas cluster

atlas-list-alerts

List MongoDB Atlas alerts

atlas-list-clusters

List MongoDB Atlas clusters

atlas-list-db-users

List MongoDB Atlas database users

atlas-list-orgs

List MongoDB Atlas organizations

atlas-list-projects

List MongoDB Atlas projects

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription
configServer configuration, supplied by the user either as environment variables or as startup arguments
debug-mongodbDebugging 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