PlugWiki
mongodb-mcp-server logo

MongoDB MCP Server: Setup for Claude, Cursor and Other Apps

OfficialLocal
Getnpmmongodb-mcp-servermongodb-js/mongodb-mcp-server

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.

Install mongodb-mcp-server

Claude Code

  1. 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. 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 · find

  • Runs 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 · aggregate

  • Runs 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-db

  • Counts documents in a collection

    Counts the documents in a collection, optionally with a filter.

    Try: “How many users signed up this month?”

    Read · count

  • Exports 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 · export

  • Shows 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 · explain

  • Lists the databases on the connection

    Lists every database on the connected MongoDB instance.

    Try: “What databases are on this server?”

    Read · list-databases

  • Lists collections in a database

    Lists the collections in one database.

    Try: “Show me the collections in the shop database.”

    Read · list-collections

  • Describes 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-schema

  • Lists indexes on a collection

    Describes the indexes on a collection.

    Try: “Which indexes exist on the orders collection?”

    Read · collection-indexes

  • Gets the size of a collection

    Returns how much storage a collection uses.

    Try: “How big is the events collection?”

    Read · collection-storage-size

  • Shows 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-stats

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

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-onlySet MDB_MCP_READ_ONLY=true or pass --readOnly. Tools that create, update or delete are then not registered.
Talks toYour MongoDB deployment. MongoDB Atlas API (Atlas tools). MongoDB Assistant knowledge base (docs search)
Sign-in and keysA 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
  • MongoDB connection string

  • Atlas service account (Atlas tools only)

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

GitHubnpmOfficial MCP RegistryChangelogIssues

Sources

Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.

Show all 1
  1. github.com · github.com

Facts from the official MCP registry, GitHub, npm, PyPI and the Docker catalog. Updated Nov 2, 2026.