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)

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}
resources
{
  "subscribe": true,
  "listChanged": true
}
completions
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
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-schemaA

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

Returns statistics that reflect the use state of a single database

explainA

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

List all databases for a MongoDB connection

mongodb-logsA

Returns the most recent logged mongod events

atlas-connect-clusterC

Connect to MongoDB Atlas cluster

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

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

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