
MongoDB MCP Server: Setup for Claude, Cursor and Other Apps
Lets Claude, Cursor and other assistants query your MongoDB data and manage MongoDB Atlas clusters.
This is MongoDB's own server. It runs on your computer and connects to any MongoDB database with a connection string. It can also manage Atlas projects and clusters if you give it Atlas service account credentials.
The tools can insert, change and drop data, so start with read-only mode, which the README turns on in every example. Dangerous tools such as dropping a database ask you to confirm first, if your app supports that.
Good for
- Developers who want to explore and query a database in plain language
- Teams on MongoDB Atlas who manage clusters, users and access from an assistant
- Analysts who need quick counts, schemas and exports
Works in
12 should work
Tap an app to see how to set it up and any known problems.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Client does not support this transport.
Client does not support this transport.
Install mongodb-mcp-server
Claude Code
- 1
Copy this prompt.
Add the mongodb-mcp-server server to Claude Code. Run this command: claude mcp add mongodb -- npx -y mongodb-mcp-server Then check that it loaded and tell me if I need to sign in or restart.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js.
Built from the package data we hold. Not yet tested by us.
Tools
Finds documents in a collection
Runs a find query with an optional filter, sort and limit and returns the matching documents.
Try: “Find the 10 most recent orders in the shop database where status is pending.”
Read ·
findRuns an aggregation on a collection
Runs an aggregation pipeline on one collection. Pipelines with a $out or $merge stage write to a collection and ask you to confirm first.
Try: “Group the orders collection by customer and total the amount spent.”
Write ·
aggregateRuns a database-level aggregation
Runs an aggregation pipeline against a whole database instead of one collection. Pipelines with $out or $merge ask you to confirm first.
Try: “List the current operations running on the database.”
Write ·
aggregate-dbCounts documents in a collection
Counts the documents in a collection, optionally with a filter.
Try: “How many users signed up this month?”
Read ·
countExports query results as EJSON
Exports the result of a find or aggregation in EJSON format. The data is available as a resource and also saved to a path on your computer.
Try: “Export all open support tickets to a file.”
Files ·
exportShows how a query would run
Returns the query plan for a find, aggregate or count, so you can see if it uses an index.
Try: “Explain this find on orders by customer_id and tell me if it uses an index.”
Read ·
explainLists the databases on the connection
Lists every database on the connected MongoDB instance.
Try: “What databases are on this server?”
Read ·
list-databasesLists collections in a database
Lists the collections in one database.
Try: “Show me the collections in the shop database.”
Read ·
list-collectionsDescribes the fields in a collection
Samples documents from a collection and describes the fields and types it finds.
Try: “What fields do documents in users have?”
Read ·
collection-schemaLists indexes on a collection
Describes the indexes on a collection.
Try: “Which indexes exist on the orders collection?”
Read ·
collection-indexesGets the size of a collection
Returns how much storage a collection uses.
Try: “How big is the events collection?”
Read ·
collection-storage-sizeShows database statistics
Returns usage statistics for one database, such as size and object counts.
Try: “Give me the stats for the shop database.”
Read ·
db-statsReads recent server log events
Returns the most recent logged events from the mongod server.
Try: “Show recent warnings in the MongoDB logs.”
Read ·
mongodb-logsConnects to a MongoDB instance
Opens a connection from a connection string and returns a connection ID that other tools use. Several connections can be open at once.
Try: “Connect to mongodb://localhost:27017.”
Network ·
connectCloses a connection
Closes a MongoDB connection and revokes its connection ID.
Try: “Disconnect from the production cluster.”
Network ·
disconnectLists open connections
Lists the active MongoDB connections and their IDs so you can reuse one.
Try: “Which connections are open right now?”
Read ·
list-connectionsAdds documents to a collection
Inserts a list of documents into a collection. Very large lists should be sent in batches.
Try: “Insert these three test users into the users collection.”
Write ·
insert-manyChanges documents that match a filter
Updates every document in a collection that matches a filter.
Try: “Set status to archived on all orders older than 2023.”
Write ·
update-manyCreates a collection
Creates a collection in a database. The database is created too if it does not exist.
Try: “Create a logs collection in the shop database.”
Write ·
create-collectionCreates an index
Creates an index on a collection.
Try: “Add an index on email in the users collection.”
Write ·
create-indexRenames a collection
Renames a collection in a database.
Try: “Rename temp_orders to orders_archive.”
Write ·
rename-collectionDeletes documents that match a filter
Removes every document in a collection that matches the filter. It asks you to confirm by default.
Try: “Delete all test users whose email ends in @example.com.”
Delete ·
delete-manyDeletes a collection
Removes a collection or view and its indexes. It asks you to confirm by default.
Try: “Drop the temp_orders collection.”
Delete ·
drop-collectionDeletes a whole database
Removes a database and its data files. It asks you to confirm by default.
Try: “Drop the staging database.”
Delete ·
drop-databaseDeletes an index
Drops an index from a collection. It asks you to confirm by default.
Try: “Drop the old email_1 index on users.”
Delete ·
drop-indexLists your Atlas organizations
Lists the MongoDB Atlas organizations the credentials can see.
Try: “Which Atlas organizations do I have?”
Network ·
atlas-list-orgsLists your Atlas projects
Lists Atlas projects.
Try: “List my Atlas projects.”
Network ·
atlas-list-projectsLists Atlas clusters
Lists the clusters in an Atlas project.
Try: “What clusters are in my Production project?”
Network ·
atlas-list-clustersShows details of an Atlas cluster
Returns metadata about one Atlas cluster.
Try: “Show me the config of the orders-prod cluster.”
Network ·
atlas-inspect-clusterConnects to an Atlas cluster
Connects to an Atlas cluster and returns a connection ID for the database tools. It creates a temporary database user to do so.
Try: “Connect to the orders-prod cluster.”
Write ·
atlas-connect-clusterLists Atlas database users
Lists the database users in an Atlas project.
Try: “Which database users exist in this project?”
Network ·
atlas-list-db-usersShows allowed IPs for Atlas
Shows the IP addresses and CIDR ranges allowed to reach your Atlas clusters.
Try: “Which IPs can reach my clusters?”
Network ·
atlas-inspect-access-listLists triggered Atlas alerts
Lists the alerts Atlas has raised for a project. It shows open alerts unless you ask for tracking or closed ones.
Try: “Are there open alerts on my project?”
Network ·
atlas-list-alertsGets Atlas performance advice
Returns suggested indexes, indexes to drop, schema suggestions and up to 50 recent slow queries.
Try: “Why is my orders cluster slow? Check the performance advisor.”
Network ·
atlas-get-performance-advisorLists Atlas regions
Lists the regions Atlas supports for a cloud provider.
Try: “Which AWS regions can I use for a new cluster?”
Network ·
atlas-get-regionsCreates an Atlas project
Creates a new Atlas project.
Try: “Create an Atlas project called analytics.”
Write ·
atlas-create-projectCreates a free Atlas cluster
Creates a free-tier Atlas cluster.
Try: “Spin up a free cluster for testing in project analytics.”
Write ·
atlas-create-free-clusterCreates a paid Atlas cluster
Creates a dedicated cluster from M10 to M80 with compute and disk autoscaling. This spends money on your Atlas account.
Try: “Create an M10 replica set cluster in us-east-1.”
Write ·
atlas-create-clusterCreates an Atlas database user
Creates a database user in an Atlas project with the roles you give it. It asks you to confirm by default.
Try: “Create a read-only user for the analytics database.”
Write ·
atlas-create-db-userAllows an IP to reach Atlas
Adds IP addresses or CIDR ranges, or your current IP, to the Atlas access list. It asks you to confirm by default.
Try: “Allow my current IP to access the cluster.”
Write ·
atlas-create-access-listLoads sample data into a cluster
Starts loading a MongoDB sample dataset into a cluster, or checks the progress of a load.
Try: “Load the sample dataset into my test cluster.”
Write ·
atlas-load-sample-datasetPauses or resumes a cluster
Pauses or resumes a dedicated (M10 and up) Atlas cluster.
Try: “Pause the staging cluster tonight.”
Write ·
atlas-pause-resume-clusterUpgrades or scales a cluster
Upgrades a free or Flex cluster, or scales a dedicated cluster to another size, including autoscaling settings.
Try: “Scale orders-prod up to M30.”
Write ·
atlas-upgrade-clusterInspects Atlas stream processing
Lists and inspects Atlas Stream Processing workspaces, connections and processors, and helps debug a failing processor.
Try: “Why is my Kafka processor failing?”
Network ·
atlas-streams-discoverCreates stream processing resources
Creates Atlas Stream Processing workspaces, connections and processors.
Try: “Set up a Kafka to Atlas pipeline in a new workspace.”
Write ·
atlas-streams-buildChanges stream processing resources
Starts and stops processors, changes pipelines and updates workspace settings. It asks you to confirm by default.
Try: “Stop the orders processor and change its pipeline.”
Write ·
atlas-streams-manageDeletes stream processing resources
Deletes workspaces, connections and processors after a basic safety check. It asks you to confirm by default.
Try: “Remove my old streams workspace.”
Delete ·
atlas-streams-teardownLists local Atlas deployments
Lists the MongoDB Atlas local deployments on your machine.
Try: “What local Atlas deployments do I have?”
Read ·
atlas-local-list-deploymentsCreates a local Atlas deployment
Creates a MongoDB Atlas local deployment. It uses the preview image unless you name a tag.
Try: “Create a local Atlas deployment for testing.”
Write ·
atlas-local-create-deploymentConnects to a local deployment
Connects to a local Atlas deployment and returns a connection ID for the database tools.
Try: “Connect to my local Atlas deployment.”
Read ·
atlas-local-connect-deploymentDeletes a local deployment
Deletes a MongoDB Atlas local deployment.
Try: “Delete the local deployment called dev-test.”
Delete ·
atlas-local-delete-deploymentLists MongoDB docs sources
Lists the data sources in the MongoDB Assistant knowledge base, so you can filter searches.
Try: “Which sources can you search for MongoDB answers?”
Network ·
list-knowledge-sourcesSearches MongoDB docs and guidance
Searches the MongoDB Assistant knowledge base, which includes official docs and expert guidance, with optional source and version filters.
Try: “How do I set up a TTL index? Check the MongoDB docs.”
Network ·
search-knowledge
From the official docs
Permissions
high risk · 4 things to watch
High risk
The assistant can read, change and delete data in any database the connection string reaches, and can create Atlas clusters that cost money. Turn on read-only mode and use a database user that can only read what you need.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only modeHow to turn it on
Watch out for
It can delete data and whole databases
Tools can delete documents, collections, indexes and databases. Run it with read-only mode, or keep the default confirmation prompts and use an app that supports them. github.com
Atlas tools can create paid clusters
The Atlas tools can create dedicated clusters, users and network access entries. Give the service account only the permissions you need. github.com
No sign-in if you expose it to a network
The README says the command-line server has no built-in authentication and is meant for one user on localhost. Do not bind it to a public address. github.com
Confirmation needs app support
Confirmation prompts work only in apps that support elicitation. Without it, rely on read-only mode. github.com
Security advisories
No published security advisories as of Nov 1, 2026.
Technical details
| Turning on read-only | Set MDB_MCP_READ_ONLY=true or pass --readOnly. Tools that create, update or delete are then not registered. |
|---|---|
| Talks to | Your MongoDB deployment. MongoDB Atlas API (Atlas tools). MongoDB Assistant knowledge base (docs search) |
| Sign-in and keys | A MongoDB connection string or Atlas service account ID and secret, passed as environment variables on your computer. The README recommends environment variables over command-line arguments. |
| Scopes |
|
Questions
Is this the official MongoDB MCP server?
Yes. It is published by MongoDB's own GitHub organization, mongodb-js, and the README links to MongoDB's documentation.
Can I run it read-only?
Yes. Set the MDB_MCP_READ_ONLY environment variable to true or add the --readOnly flag. Every example in the README does this by default.
Do I need an Atlas account?
No. A connection string for any MongoDB deployment is enough for the database tools. The Atlas tools need Atlas service account credentials.
Can it delete my data?
Yes, unless read-only mode is on. Delete tools ask for confirmation by default, but only in apps that support confirmation prompts.
Does it run locally or in the cloud?
The package runs on your computer, and a Docker image is also available. MongoDB also offers a separate hosted Atlas server that signs in with OAuth, described in the README.
Which Node.js version does it need?
Node.js 22.13 or later, according to the README. Node 20 is deprecated.
How do I add it to Claude or Cursor?
Use the install box above. Then add your connection string as an environment variable, as the README shows, and add --readOnly if you want read-only access.
Information
updated Nov 2, 2026
- Publisher
- Official
- Package
mongodb-mcp-server- Registry
- npm
- Transport
- stdio
- Auth
- token in env
- Version
- 3.2.1
- License
- Apache-2.0
- Last commit
- Oct 30, 2026
- Open issues
- 10
- Listed in
- Official MCP registry, Docker MCP Catalog
Sources
Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.
Show all 1Hide
- github.com · github.com