MongoDB MCP Server
@yairsabag
About MongoDB MCP Server
No overview available yet
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mongodb-mcp-server-new": {
"command": "npx",
"args": [
"-y",
"mongodb-mcp-server",
"--apiClientId=your-atlas-service-accounts-client-id",
"--apiClientSecret=your-atlas-service-accounts-client-secret"
]
}
}
}Tools
48Run an aggregation against a MongoDB database
Run an aggregation against a MongoDB collection
Describe the indexes for a collection
Describe the schema for a collection
Gets the size of the collection
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.
Gets the number of documents in a MongoDB collection using db.collection.count() and query as an optional filter parameter
Creates a new collection in a database. If the database doesn't exist, it will be created automatically.
Create an index for a collection
Returns statistics that reflect the use state of a single database
Removes all documents that match the filter from a MongoDB collection
Close a MongoDB connection and revoke its connectionId.
Removes a collection or view from the database. The method also removes any indexes associated with the dropped collection.
Removes the specified database, deleting the associated data files
Drop an index for the provided database and collection.
Returns statistics describing the execution of the winning plan chosen by the query optimizer for the evaluated method
Export a query or aggregation results in the specified EJSON format.
Run a find query against a MongoDB collection
Insert an array of documents into a MongoDB collection. If the list of documents is above com.mongodb/maxRequestPayloadBytes, consider inserting them in batches.
List all collections for a given database
List the active MongoDB connections and their connectionIds. Use this to find a connectionId established earlier.
List all databases for a MongoDB connection
Returns the most recent logged mongod events
Renames a collection in a MongoDB database
Updates all documents that match the specified filter for a collection. If the list of documents is above com.mongodb/maxRequestPayloadBytes, consider updating them in batches.
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.
Allow Ip/CIDR ranges to access your MongoDB Atlas clusters.
Create a MongoDB Atlas cluster (M10โM80, replica set or single shard, single or multi-region). Compute autoscaling is enabled by default: min instance size is set to the selected instance size, max is set two tiers above. Disk autoscaling is always enabled. For encryption at rest, the CMK provider must already have a valid configuration in the Atlas project. The tool returns immediately, use the atlas-inspect-cluster tool to poll the cluster state for readiness (state: IDLE). Connection strings are unavailable until the cluster reaches IDLE state. Note to LLM: Omit instance size unless specified by the user. If provider and regions are not already known, ask for both together in a single question before calling this tool. Common, non-exhaustive region default mappings by provider: AWS: "East Coast"/"Virginia"/"US East" โ US_EAST_1, "Ohio" โ US_EAST_2, "California"/"West Coast" โ US_WEST_2, "Southeast Asia"/"APAC"/"Singapore" โ AP_SOUTHEAST_1, "Europe"/"EU"/"Ireland" โ EU_WEST_1. GCP: "Central US" โ CENTRAL_US, "Western US" โ WESTERN_US, "Southeast Asia"/"APAC" โ SOUTHEASTERN_ASIA_PACIFIC, "Europe"/"EU" โ WESTERN_EUROPE. AZURE: "East US" โ US_EAST_2, "West US" โ US_WEST_2, "Europe North" โ EUROPE_NORTH, "Europe West" โ EUROPE_WEST. Default recommendation: AWS US_EAST_1. User-specified regions not present in the mapping MUST be respected, rely on the tool to surface errors if a region is not supported.
Create an MongoDB Atlas database user
Create a free MongoDB Atlas cluster
Create a MongoDB Atlas project
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
Inspect Ip/CIDR ranges with access to your MongoDB Atlas clusters.
Inspect metadata of a MongoDB Atlas cluster
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.
List MongoDB Atlas clusters
List MongoDB Atlas database users
List MongoDB Atlas organizations
List MongoDB Atlas projects.
Load a MongoDB sample dataset into an Atlas cluster, or check the status of a previously-initiated load. To start a new load, provide `clusterName` โ the load runs asynchronously and the response includes a `jobId` and initial state. To check progress, call this tool again with `jobId` (sample dataset loads typically take 1โ5 minutes). State can be WORKING, COMPLETED, or FAILED.
Pause or resume a dedicated (M10+) MongoDB Atlas cluster (Free and Flex clusters cannot be paused). Pause: paused clusters are unavailable for connections and do not incur compute costs. If the cluster being paused is the current active connection, it will be automatically disconnected. Returns an error if the cluster is already paused or not in a pausable state (must be IDLE). Resume: the cluster will not be immediately available after resuming. Use the atlas-inspect-cluster tool to poll the cluster state for readiness (state: IDLE). If the cluster is not paused, resuming it is a no-op.
Create Atlas Stream Processing resources. Use this tool for 'set up a Kafka pipeline', 'create a workspace', 'add a connection', or 'deploy a processor'. Use resource='workspace' to create a new workspace (specify cloud provider, region, and tier). Use resource='connection' to add a data source or sink to an existing workspace. Use resource='processor' to deploy a stream processor with a pipeline. Use resource='privatelink' to set up private networking. Typical workflow: create workspace โ add connections โ deploy processor.
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.
Manage Atlas Stream Processing resources: start/stop processors, modify pipelines, update configurations. Also use for 'change the pipeline', 'scale up my processor', or 'update my workspace tier'. Common workflow: action='stop-processor' โ action='modify-processor' โ action='start-processor'. Use `atlas-streams-discover` with action 'inspect-processor' to check state before managing.
Delete Atlas Stream Processing resources. Also use for 'remove my workspace', 'disconnect a source', 'delete all processors', or 'clean up my streams environment'. Performs basic safety checks before deletion: summarizes counts of processors and connections, highlights connections referenced by processors where possible, and surfaces API errors if processors are still running when deletion is attempted. Use `atlas-streams-discover` to review resources before deleting.
Upgrade a MongoDB Atlas cluster tier. Upgrades Free (M0) clusters to Flex or M10 Dedicated, or Flex clusters to M10 Dedicated. The upgrade path is determined automatically from the current tier unless overridden with targetTier. Note to LLM: If provider and region are not already known, ask for both together in a single question before calling this tool. Common region mappings by provider (default recommendation: AWS US_EAST_1): AWS: "East Coast"/"Virginia"/"US East" โ US_EAST_1, "Ohio" โ US_EAST_2, "California"/"West Coast" โ US_WEST_2, "Southeast Asia"/"APAC"/"Singapore" โ AP_SOUTHEAST_1, "Europe"/"EU"/"Ireland" โ EU_WEST_1. GCP: "Central US" โ CENTRAL_US, "Western US" โ WESTERN_US, "Southeast Asia"/"APAC" โ SOUTHEASTERN_ASIA_PACIFIC, "Europe"/"EU" โ WESTERN_EUROPE. AZURE: "East US" โ US_EAST_2, "West US" โ US_WEST_2, "Europe"/"EU" โ EUROPE_NORTH.
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 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.
Overview
What is MongoDB MCP Server?
A Model Context Protocol server for interacting with MongoDB Databases and MongoDB Atlas. It provides tools for managing Atlas resources and performing database operations, intended for developers using MCP-compatible clients.
How to use MongoDB MCP Server?
Requires Node.js v20.10.0+ and either a MongoDB connection string or Atlas API credentials; the server will not start without these. Run via npx -y mongodb-mcp-server with command-line arguments or environment variables, or use a Docker container. Configuration can be placed in an MCP client settings file (e.g., for Windsurf, VSCode, Claude Desktop, Cursor). Tools are divided into Atlas management and database CRUD categories.
Key features of MongoDB MCP Server
- Supports MongoDB Atlas administrative tools and direct database operations
- Configurable via command-line arguments, environment variables, or MCP client config
- Read-only mode restricts tools to read and metadata operations only
- Tool disabling by name, operation type, or category (atlas, mongodb)
- Docker support for isolated execution without local Node.js
- Telemetry collection can be disabled via configuration or
DO_NOT_TRACK
Use cases of MongoDB MCP Server
- Managing MongoDB Atlas organizations, projects, clusters, and access lists from an LLM interface
- Running database queries (find, aggregate) and document modifications through natural language
- Inspecting collection schemas, indexes, and storage sizes for analysis
- Automating cluster creation, user management, and alert monitoring
FAQ from MongoDB MCP Server
What prerequisites are needed to run the server?
Node.js v20.10.0 or later and either a MongoDB connection string or Atlas API credentials. The server will not start without these credentials.
How can I disable certain tools or categories?
Use the disabledTools configuration option with a comma-separated string (env) or space-separated list (CLI). Categories include atlas, mongodb; operation types include create, update, delete, read, metadata.
Does the server support read-only mode?
Yes. Set readOnly=true via environment variable or --readOnly argument. This prevents all create, update, and delete operations from registering with the server.
Can I run it without installing Node.js?
Yes, using Docker. Pull mongodb/mongodb-mcp-server:latest and pass credentials via environment variables or run without options for an interactive setup.
Is telemetry collected? Can it be disabled?
Telemetry is collected by default but can be disabled using the telemetry option set to disabled, or by setting the DO_NOT_TRACK=1 environment variable.
Frequently asked questions
What prerequisites are needed to run the server?
Node.js v20.10.0 or later and either a MongoDB connection string or Atlas API credentials. The server will not start without these credentials.
How can I disable certain tools or categories?
Use the `disabledTools` configuration option with a comma-separated string (env) or space-separated list (CLI). Categories include `atlas`, `mongodb`; operation types include `create`, `update`, `delete`, `read`, `metadata`.
Does the server support read-only mode?
Yes. Set `readOnly=true` via environment variable or `--readOnly` argument. This prevents all create, update, and delete operations from registering with the server.
Can I run it without installing Node.js?
Yes, using Docker. Pull `mongodb/mongodb-mcp-server:latest` and pass credentials via environment variables or run without options for an interactive setup.
Is telemetry collected? Can it be disabled?
Telemetry is collected by default but can be disabled using the `telemetry` option set to `disabled`, or by setting the `DO_NOT_TRACK=1` environment variable.
Basic information
More Databases MCP servers
mcp_mysql_server
xwb602625136Model Context Protocol (MCP) server that supports secure interaction with MySQL databases and has anomaly analysis capabilities.ๆดๅ ็้ผ๏ผๆดๅ ๅฅฝ็จ๏ผไธไป ๆญขไบmysql็ๅขๅ ๆนๆฅๅ่ฝ๏ผ ่ฟๅ ๅซไบๆฐๆฎๅบๅผๅธธๅๆ่ฝๅ๏ผไธไพฟไบๅผๅ่ ไปฌ่ฟ่กไธชๆงๅ็ๅทฅๅ ทๆฉๅฑ

PostgreSQL
modelcontextprotocolModel Context Protocol Servers

Lawstronaut
Lawstronaut-FZCOAccess millions of official legal and regulatory source documents from 155+ jurisdictions via MCP. Lawstronaut supports AI agents with structured legal research, legal data, laws, regulations, cases, guidance, official s
MCP MongoDB Server
kiliczshA Model Context Protocol Server for MongoDB
MCP Alchemy
runekaagaardA MCP (model context protocol) server that gives the LLM access to and knowledge about relational databases like SQLite, Postgresql, MySQL & MariaDB, Oracle, and MS-SQL.
Comments