Verified

MongoDB MCP Server

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

Data last scanned yesterday · Reviewed 2 months ago

606 dangerous tools58 tools1,087TypeScriptApache-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

Compatibility

ClientLocalDockerRemoteRead-only
ChatGPT
Claude Desktop
Cursor
VS Code
Windsurf

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.