MongoDB MCP Server

Query, inspect, and manage MongoDB database collections via natural language commands.

Data last scanned today · Reviewed yesterday

626 dangerous tools58 tools1,084TypeScriptApache-2.0

Overview

The MongoDB MCP Server allows AI assistants to interact directly with MongoDB databases. By providing a connection string, users can enable their tools to perform operations on collections and documents, facilitating data-driven tasks directly from the chat interface.

Our verdict

This server carries a high-risk rating due to significant security concerns. Most notably, there is no authentication mechanism, meaning any entity with access to the configuration can interact with the database. Additionally, it lacks formal support for OAuth and is maintained by the community rather than the official vendor, leaving users without direct recourse. It should only be used in highly controlled, isolated environments.

  • Supports 30 direct dependencies for a reduced supply-chain footprint.
  • Features active maintenance with 44 contributors.
  • Documentation provided in the repository README.
  • Lack of built-in authentication exposes the server to unauthorized access.
  • Absence of OAuth support restricts secure credential management.
  • Community-maintained project without official vendor backing.

Setup

Claude Desktop
{
  "mcpServers": {
    "mongodb-mcp-server": {
      "args": [
        "-y",
        "mongodb-mcp-server"
      ],
      "command": "npx"
    }
  }
}

Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows), then restart Claude Desktop. Some servers require API keys or tokens as environment variables — check the project's README and add an "env" object if needed.

  • No read-only mode — running this grants full read/write access.
  • No built-in authentication — anyone with access to this config can invoke every tool it exposes.

Tools

ToolDescriptionRisk
aggregateRun an aggregation against a MongoDB collectionlow
aggregate-dbRun an aggregation against a MongoDB databaselow
collection-indexesDescribe the indexes for a collectionlow
collection-schemaDescribe the schema for a collectionlow
collection-storage-sizeGets the size of the collectionlow
connectConnect to a MongoDB instancelow
countGets the number of documents in a MongoDB collection using db.collection.count() and query as an optional filter parameterlow
create-collectionCreates a new collection in a database. If the database doesn't exist, it will be created automatically.medium
create-indexCreate an index for a collectionmedium
db-statsReturns statistics that reflect the use state of a single databaselow
delete-manyRemoves all documents that match the filter from a MongoDB collectionhigh
drop-collectionRemoves a collection or view from the database. The method also removes any indexes associated with the dropped collection.high
drop-databaseRemoves the specified database, deleting the associated data fileshigh
drop-indexDrop an index for the provided database and collection.high
explainReturns statistics describing the execution of the winning plan chosen by the query optimizer for the evaluated methodlow
exportExport a query or aggregation results in the specified EJSON format.low
findRun a find query against a MongoDB collectionlow
insert-manyInsert an array of documents into a MongoDB collection. If the list of documents is above com.mongodb/maxRequestPayloadBytes, consider inserting them in batches.medium
list-collectionsList all collections for a given databaselow
list-databasesList all databases for a MongoDB connectionlow
mongodb-logsReturns the most recent logged mongod eventslow
rename-collectionRenames a collection in a MongoDB databasemedium
switch-connectionSwitch to a different MongoDB connectionlow
update-manyUpdates 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.medium
atlas-connect-clusterConnect to MongoDB Atlas clusterlow
atlas-create-access-listAllow Ip/CIDR ranges to access your MongoDB Atlas clusters.medium
atlas-create-clusterCreate a MongoDB Atlas cluster (M10–M80, replica set or single shard). 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. 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.medium
atlas-create-db-userCreate an MongoDB Atlas database usermedium
atlas-create-free-clusterCreate a free MongoDB Atlas clustermedium
atlas-create-projectCreate an MongoDB Atlas projectmedium
atlas-get-performance-advisorGet 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 logslow
atlas-inspect-access-listInspect Ip/CIDR ranges with access to your MongoDB Atlas clusters.low
atlas-inspect-clusterInspect metadata of a MongoDB Atlas clusterlow
atlas-list-alertsList 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.low
atlas-list-clustersList MongoDB Atlas clusterslow
atlas-list-db-usersList MongoDB Atlas database userslow
atlas-list-orgsList MongoDB Atlas organizationslow
atlas-list-projectsList MongoDB Atlas projectslow
atlas-load-sample-datasetLoad 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.medium
atlas-pause-resume-clusterPause or resume a dedicated (M10+) MongoDB Atlas cluster.medium
atlas-streams-buildCreate 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.medium
atlas-streams-discoverDiscover 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.low
atlas-streams-manageManage 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.medium
atlas-streams-teardownDelete 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.high
atlas-upgrade-clusterUpgrade 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):medium
atlas-local-connect-deploymentConnect to a MongoDB Atlas Local deploymentlow
atlas-local-create-deploymentCreate a MongoDB Atlas local deployment. Default image is preview. When the user does not specify an image tag, inform them that preview is used by default and provide this link for more information: https://hub.docker.com/r/mongodb/mongodb-atlas-localmedium
atlas-local-delete-deploymentDelete a MongoDB Atlas local deploymenthigh
atlas-local-list-deploymentsList MongoDB Atlas local deploymentslow
list-knowledge-sourcesList 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.low
search-knowledgeSearch 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.low
insert-documentInserts a document into a collection.medium
update-documentUpdates a document in a collection.medium
delete-documentDeletes a document from a collection.medium
list-clustersLists MongoDB Atlas clusters.low
create-clusterCreates a new MongoDB Atlas cluster.medium
list-indexesLists indexes for a specific collection.low
infer-collection-schemaInfers the schema of a MongoDB collection.low

Compatibility

ClientLocalDockerRemoteRead-only
Claude Desktop
Cursor
VS Code
Windsurf
ChatGPT

Frequently asked questions

What are the Node.js version requirements?

This server requires Node.js v22.13.0 or later. Support for Node 20.x is deprecated.

What credentials are required to use MongoDB Atlas tools?

You must use Atlas Service Account API credentials to access MongoDB Atlas tools.

Can I connect to a MongoDB instance without Atlas credentials?

Yes, you can use a standard MongoDB connection string to connect directly to your MongoDB instance.

How can I ensure the server operates with limited database access?

You can configure the server with the --readOnly command-line argument to restrict operations.

Are there specific security practices recommended for Atlas credentials?

You should assign only the minimum required permissions to the service account used for Atlas API access.

Alternatives

Changelog

Badge

MongoDB MCP Server security score, rated on RepoAI

Maintain this server? Add the live badge to your README.