Skip to main content
Glama

MongoDB MCP Server

Official
by mongodb-js
Apache 2.0
12,662
536
  • Apple
  • Linux

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)

Schema

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

Tools

Functions exposed to the LLM to take actions

NameDescription
connect

Connect to a MongoDB instance

list-collections

List all collections for a given database

list-databases

List all databases for a MongoDB connection

collection-indexes

Describe the indexes for a collection

create-index

Create an index for a collection

collection-schema

Describe the schema for a collection

find

Run a find query against a MongoDB collection

insert-many

Insert an array of documents into a MongoDB collection

delete-many

Removes all documents that match the filter from a MongoDB collection

collection-storage-size

Gets the size of the collection

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

aggregate

Run an aggregation against a MongoDB collection

update-many

Updates all documents that match the specified filter for a collection

rename-collection

Renames a collection in a MongoDB database

drop-database

Removes the specified database, deleting the associated data files

drop-collection

Removes a collection or view from the database. The method also removes any indexes associated with the dropped collection.

explain

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

create-collection

Creates a new collection in a database. If the database doesn't exist, it will be created automatically.

mongodb-logs

Returns the most recent logged mongod events

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